VirtualBox

Changeset 51156 in vbox for trunk/src/VBox/NetworkServices


Ignore:
Timestamp:
Apr 28, 2014 4:09:33 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93486
Message:

Convince Solaris headers to expose socket stuff we need in a way that
works for newer versions of g++ too. See the comment for gory details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/Makefile.kmk

    r50068 r51156  
    5757VBoxNetLwipNAT_LDFLAGS.win = /SUBSYSTEM:windows
    5858
    59 # Convince Solaris headers to expose socket stuff we need.  600 would
    60 # also work, but <sys/feature_tests.h> insists on C99 for it and so
    61 # explodes for C++.  Note that for 500 it insists on NOT using C99, so
    62 # when some day we decide to use -std=c99 we are in for some fun.
    63 VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=500 __EXTENSIONS__=1
     59# Convince Solaris headers to expose socket stuff we need.
     60#
     61# Setting _XOPEN_SOURCE to either 500 or 600 would always work, but
     62# <sys/feature_tests.h> insists that 600 requires C99 and so it
     63# explodes for older g++.  It also insists that 500 is NOT to be used
     64# with C99.
     65#
     66# Newer g++ in C++11 mode (formerly known as C++0x) needs 600, so it
     67# employs sleight of hand to pretend it's C99 to keep feature test
     68# happy.
     69#
     70# Compile the C code with settings that match g++.  This probably
     71# should be centralized so that whole codebase uses consistent
     72# settings.
     73ifeq ($(KBUILD_TARGET),solaris)
     74 ifneq ($(VBOX_GCC_VERSION_CXX),)
     75  ifneq ($(int-ge $(VBOX_GCC_VERSION_CXX),40600),)
     76   # we compile C++ code with -std=c++0x / -std=c++11
     77   VBoxNetLwipNAT_CFLAGS.solaris += -std=c99
     78   VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=600
     79  else
     80   VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=500
     81  endif
     82 endif
     83 VBoxNetLwipNAT_DEFS.solaris += __EXTENSIONS__=1
     84endif
    6485
    6586VBoxNetLwipNAT_SOURCES += \
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette