[LLVMdev] CommandLine.cpp:189: error: `strdup' undeclared

Henrik Bach henrik_bach_llvm at hotmail.com
Tue Jul 6 14:47:01 PDT 2004


Hi

>
>Are you able to explain below meaning to me?
>
>#if defined(_ALL_SOURCE)  \
>	    || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE_EXTENDED==1)) \
>	    || (__STDC__ - 0 == 0 && !defined(_POSIX_C_SOURCE))
>extern char* __cdecl strdup(const char *);
>#endif /* defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE_EXTENDED == 1) */
>

(RTFM) Some of the above macros and their meaning can be found in Interix' 
UNIX Application Migration Guide, chapter 10. An excerpt:

"To add or isolate code that implements Interix-specific features, surround 
it with #ifdef __INTERIX ..."

"The __INTERIX macro is automatically defined to be true (1) by ... the gcc 
compiler. ... Micosoft Visual C++ compiler ... defines __STDC__, unless -N 
nostdc is specified."

"The Interix header files are structured to align with the Single UNIX 
Specification. For example, string and memory functions that occur in 
POSIX.1 are in string.h. String and memory functions that are in the Single 
UNIX Specification, but not in POSIX.1, are in strings.h. ...

To get all of the APIs provided with the Interix SDK, define the _ALL_SOURCE 
value as 1 before the first header file is included ..."

"If the source is not defined, the default is the more restrictive 
_POSIX_SOURCE."

The meaning of the other macros may be defined by autoconf?


/Henrik

_________________________________________________________________
Få alle de nye og sjove ikoner med MSN Messenger http://www.msn.dk/messenger




More information about the llvm-dev mailing list