7b01b8c4   
   From: daniel.kruegler@googlemail.com   
      
   Am 27.08.2011 04:20, schrieb John Shaw:   
   > On Aug 25, 7:30 am, Brian L wrote:   
   >> This is valid code in C because "struct name" and "name" are distinct   
   >>   
   >> { the poster refers to this part of the subj line:   
   >>   
   >> typedef struct name *name;   
   >>   
   >> -mod }   
   >>   
   >> types, but not in C++ where this produces a compiler error. I have a   
   >> third party C library that uses this extensively in header files and I   
   >> need to use this in C++ code.   
   >>   
   >> Is there a way around this?   
   >   
   > Try using extern "C" to specify C linkage - you can find examples   
   > online   
   >   
   > // in header   
   > extern "C" {   
   > int my_c_function1();   
   > char* my_c_function2(int n);   
   > }   
   >   
   > // in C++ source file   
   > extern "C" {   
   > #include   
   > }   
      
   How should that solve the problem described by the OP? The compiler he   
   uses will still be a C++ compiler and will still be required to reject   
   the declaration, thus this won't fix the problem.   
      
   HTH & Greetings from Bremen,   
      
   - Daniel Krügler   
      
      
      
   --   
    [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
    [ comp.lang.c++.moderated. First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|