If _XOPEN_SOURCE_EXTENDED or _XOPEN_SOURCE are defined, _POSIX_C_SOURCE gets
authorRichard Levitte <levitte@openssl.org>
Thu, 19 Dec 2002 19:39:30 +0000 (19:39 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 19 Dec 2002 19:39:30 +0000 (19:39 +0000)
defined in DECC$TYPES.H.  If _POSIX_C_SOURCE is defined, certain types do
not get defined (u_char, u_int, ...).  DECC.H gets included by assert.h
and others.  Now, in6.h uses the types u_char, u_int and so on, and gets
included as part of other header inclusions, and will of course fail because
of the missing types.

On the other hand, _XOPEN_SOURCE_EXTENDED is needed to get gethostname()
properly declared...

Solution: define _XOPEN_SOURCE_EXTENDED much later, so DECC$TYPES.H has
a chance to be included *first*, so the otherwise missing types get defined
properly.

Personal: *mumble* *mumble*

ssl/ssltest.c

index e384599fb17b35b71e91497529f7dfc621b29b1b..fc27f018d1584094e06eb7731aad4c9eb194327b 100644 (file)
 
 #define _BSD_SOURCE 1          /* Or gethostname won't be declared properly
                                   on Linux and GNU platforms. */
 
 #define _BSD_SOURCE 1          /* Or gethostname won't be declared properly
                                   on Linux and GNU platforms. */
-#define _XOPEN_SOURCE_EXTENDED 1 /* Or gethostname won't be declared properly
-                                  on Compaq platforms (at least with DEC C).
-                               */
 
 #include <assert.h>
 #include <errno.h>
 
 #include <assert.h>
 #include <errno.h>
 #include <openssl/engine.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
 #include <openssl/engine.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
+
+#define _XOPEN_SOURCE_EXTENDED 1 /* Or gethostname won't be declared properly
+                                    on Compaq platforms (at least with DEC C).
+                                    Do not try to put it earlier, or IPv6 includes
+                                    get screwed...
+                                 */
+
 #ifdef OPENSSL_SYS_WINDOWS
 #include <winsock.h>
 #include "../crypto/bio/bss_file.c"
 #ifdef OPENSSL_SYS_WINDOWS
 #include <winsock.h>
 #include "../crypto/bio/bss_file.c"