Permalink
Browse files

Use __APPLE__ instead of MONGO_OSX_ for compatibility with Xcode and …

…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
Paul Melnikow committed Apr 4, 2012
1 parent e67f61c commit 6fd4eab5f58c94aa81be02590554731d9714953a
Showing with 3 additions and 10 deletions.
  1. +1 −1 Makefile
  2. +1 −4 SConstruct
  3. +1 −1 src/env_default.c
  4. +0 −4 src/env_posix.c
View
@@ -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)
View
@@ -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/"] )
View
@@ -29,7 +29,7 @@ int mongo_write_socket( mongo *conn, const void *buf, int len ) {
#ifdef _WIN32
int flags = 0;
#endif
-#ifdef MONGO_OSX_
+#ifdef __APPLE__
int flags = 0;
#else
int flags = MSG_NOSIGNAL;
View
@@ -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 );

2 comments on commit 6fd4eab

@paulmelnikow

This comment has been minimized.

Show comment Hide comment
@paulmelnikow

paulmelnikow Apr 4, 2012

Owner

Actually it looks like the default invocation of make does compile env_posix.c. scons compiles env_default.c. Which is correct?

Owner

paulmelnikow replied Apr 4, 2012

Actually it looks like the default invocation of make does compile env_posix.c. scons compiles env_default.c. Which is correct?

@banker

This comment has been minimized.

Show comment Hide comment
@banker

banker Apr 5, 2012

Here's the ultimate goal:

env_posix.c will support and be compiled for all posix-compliant systems.
env_default.c will be as basic and universal as possible.
env_win32.c (pending) will be for windows.

Here's the ultimate goal:

env_posix.c will support and be compiled for all posix-compliant systems.
env_default.c will be as basic and universal as possible.
env_win32.c (pending) will be for windows.

Please sign in to comment.