Skip to content

Commit

Permalink
Use __APPLE__ instead of MONGO_OSX_ for compatibility with Xcode and …
Browse files Browse the repository at this point in the history
…user-provided build systems

Modifies this commit:
7b0a0aa

I removed the ifdef from env_posix.c since that file isn't compiled on Mac OS.
  • Loading branch information
Paul Melnikow authored and banker committed Apr 5, 2012
1 parent b97d3ca commit a806ff4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -95,7 +95,7 @@ ifeq ($(kernel_name),SunOS)
BSON_DYLIB_MAKE_CMD=$(CC) -G -o $(BSON_DYLIBNAME) -h $(BSON_DYLIB_MINOR_NAME) $(ALL_LDFLAGS)
endif
ifeq ($(kernel_name),Darwin)
ALL_CFLAGS+=-std=$(STD) $(CFLAGS) $(OPTIMIZATION) $(WARNINGS) $(DEBUG) $(ALL_DEFINES) -DMONGO_OSX_
ALL_CFLAGS+=-std=$(STD) $(CFLAGS) $(OPTIMIZATION) $(WARNINGS) $(DEBUG) $(ALL_DEFINES)
DYLIBSUFFIX=dylib
MONGO_DYLIB_MINOR_NAME=$(MONGO_LIBNAME).$(DYLIBSUFFIX).$(MONGO_MAJOR).$(MONGO_MINOR)
MONGO_DYLIB_MAJOR_NAME=$(MONGO_LIBNAME).$(DYLIBSUFFIX).$(MONGO_MAJOR)
Expand Down
5 changes: 1 addition & 4 deletions SConstruct
Expand Up @@ -92,10 +92,7 @@ else:


if os.sys.platform in ["darwin", "linux2"]:
if os.sys.platform in ["darwin"]:
env.Append( CPPFLAGS=" -pedantic -Wall -ggdb -DMONGO_HAVE_STDINT -DMONGO_OSX_" )
else:
env.Append( CPPFLAGS=" -pedantic -Wall -ggdb -DMONGO_HAVE_STDINT" )
env.Append( CPPFLAGS=" -pedantic -Wall -ggdb -DMONGO_HAVE_STDINT" )
env.Append( CPPPATH=["/opt/local/include/"] )
env.Append( LIBPATH=["/opt/local/lib/"] )

Expand Down
2 changes: 1 addition & 1 deletion src/env_default.c
Expand Up @@ -29,7 +29,7 @@ int mongo_write_socket( mongo *conn, const void *buf, int len ) {
#ifdef _WIN32
int flags = 0;
#else
#ifdef MONGO_OSX_
#ifdef __APPLE__
int flags = 0;
#else
int flags = MSG_NOSIGNAL;
Expand Down
4 changes: 0 additions & 4 deletions src/env_posix.c
Expand Up @@ -43,11 +43,7 @@ static void mongo_set_error( mongo *conn, int err, const char *str ) {

int mongo_write_socket( mongo *conn, const void *buf, int len ) {
const char *cbuf = buf;
#ifdef MONGO_OSX_
int flags = 0;
#else
int flags = MSG_NOSIGNAL;
#endif

while ( len ) {
int sent = send( conn->sock, cbuf, len, flags );
Expand Down

0 comments on commit a806ff4

Please sign in to comment.