Make one of your public include files autoconf generated? Like we do for the C 
APIs definitions file.

Just a thought.

-- Leif 



> On Oct 3, 2014, at 10:06 PM, Brian Geffon <briangef...@gmail.com> wrote:
> 
> Hey all,
> So there is a weird situation we're in with the c++ api where it has a
> dependency on shared_ptr which can exist in memory or tr1/memory and
> similarly in the namespace std:: and std;:tr1::, so in the c++ api's
> shared_ptr.h file we have the following mess:
> 
> 
> #include "ink_autoconf.h"
> #if HAVE_STD_SHARED_PTR
> #  include <memory>
> #else
> #  include <tr1/memory>
> #endif
> 
> namespace atscppapi {
> #if HAVE_STD_SHARED_PTR
>  using std::shared_ptr;
> #else
>  using std::tr1::shared_ptr;
> #endif
> }
> 
> And we're including ink_autoconf.h only because it determines which
> implementation of shared_ptr the user has. This can't work because this
> file is installed and ink_autoconf.h no longer exists. amc, suggested the
> following trick to handle the namespacing but it still falls short when
> determining which file to include, does anyone have ideas of how we can
> remove this dependency on ink_autoconf.h?
> 
> namespace tr1 { }
> namespace std_tr1 {
>  using namespace std;
>  using namespace tr1;
> }
> 
> namespace atscppapi {
>  using std_tr1::shared_ptr;
> }
> 
> 
> Brian
> 
>> On Fri, Oct 3, 2014 at 9:03 PM, Brian Geffon <briangef...@gmail.com> wrote:
>> 
>> Hey all,
>> So there is a weird situation we're in with the c++ api where it has a
>> dependency on shared_ptr which can exist in memory or tr1/memory and
>> similarly in the namespace std:: and std;:tr1::, so in the cppapi's
>> shared_ptr.h file we have the following mess:
>> #include "ink_autoconf.h"
>> 
>> 
>> #if HAVE_STD_SHARED_PTR
>> 
>> #  include <memory>
>> #else
>> 
>> #  include <tr1/memory>
>> 
>> #endif
>> 
>> 
>> namespace atscppapi {
>> 
>> #if HAVE_STD_SHARED_PTR
>> 
>>  using std::shared_ptr;
>> 
>> #else
>> 
>>  using std::tr1::shared_ptr;
>> 
>> #endif
>> 
>> 
>> } /* atscppapi */
>> 

Reply via email to