Michael C. Toren on Thu, 20 Jun 2002 15:35:45 -0400 |
> I'm trying to build some C/C++ code that makes use of networking. > So far I've identified 2 differences for this host os: AF_INET6 is not > defined in the networking header files (grrr...), and SIOCGIFFLAGS > (SIOCGIFCONF and SIOCGIFADDR) is in sys/sockio.h (which also happens to be > available through ioctl.h). To find SIOCGIFFLAGS and friends, I've done this in the past: #include <sys/ioctl.h> #ifndef __OpenBSD__ #include <net/if.h> /* work around OpenBSD double include bug */ #endif #ifndef SIOCGIFCONF #include <sys/sockio.h> /* Solaris, maybe others? */ #endif If you want an #ifdef that will identify Solaris systems, try: #if defined (__SVR4) && defined (__sun) Also: gcc -E -dM - < /dev/null Is useful for seeing what #define's gcc is setting for you on various architectures. Good luck, -mct P.S., my personal belief is that this is very on-topic for PLUG
|
|