diff -r 367e5999a90e make/defines___.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/defines___.mk Mon Jul 20 12:56:34 2009 +0530 @@ -0,0 +1,153 @@ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# +# THE BSD LICENSE +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# Neither the name of the nor the names of its contributors may be +# used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +include $(BUILD_ROOT)/make/defines_UNIX.mk +LOCAL_COPY=0 + +PERL_DIR =/usr +PERL5 =$(PERL_DIR)/bin/perl +PERL =$(PERL5) +CC =$(PRE_CC) /usr/bin/g++ +C =$(PRE_C) /usr/bin/gcc +C++C =$(CC) +AR =/usr/bin/ar -s +TAR =/usr/bin/tar +RANLIB =/usr/bin/ranlib +LD =$(PRE_LD) /usr/bin/g++ +ZIP =/usr/bin/zip +UNZIP =/usr/bin/unzip +GZIP =/usr/bin/gzip +GUNZIP =/usr/bin/gunzip +SHELL =/bin/sh +DATE =/bin/date +MKDIR =/bin/mkdir +TOUCH =/usr/bin/touch +CHMOD =/bin/chmod +CP =/bin/cp +MV =/bin/mv +ECHO =/bin/echo +SED =/usr/bin/sed +LN =/bin/ln -f +NMAKE =/usr/bin/make -f +STRIP =/usr/bin/strip -x +RM =/bin/rm + +# -L flag dereferences symbolic links, else symlinks are copied as is +CP_R =/bin/cp -rL + +ifndef GCC_VERSION +GCC_VERSION = $(shell $(C) -dumpversion) +endif + +BASEFLAGS = -Wall + +ifdef DEBUG_BUILD +# easy on the warnings for now +CC_DEBUG = -g $(BASEFLAGS) -Wno-unknown-pragmas -Wno-non-virtual-dtor -Wno-unused +C_DEBUG = -g $(BASEFLAGS) +LD_DEBUG = +else +# optimized settings here +CC_DEBUG = -O3 $(BASEFLAGS) -Wno-unknown-pragmas -Wno-non-virtual-dtor -Wno-unused +C_DEBUG = -O3 $(BASEFLAGS) +LD_DEBUG = -s +endif + +RPATH_PREFIX = -Wl,-rpath, +RPATH_ORIGIN = \$$ORIGIN + +PLATFORM_DEF = -DDARWIN -D_REENTRANT -D_LARGEFILE64_SOURCE + +# -verbose for printing all informational messags +# -w0 for stricter than ANSI-C prototype warnings +# -fPIC is needed for any code that ends up in a shared library +ifndef NO_KPIC +PLATFORM_CC_OPTS = -fPIC +PLATFORM_C_OPTS = -fPIC +endif +PLATFORM_LD_OPTS = +LD_DYNAMIC = $(PLATFORM_LD_OPTS) -dynamiclib +LD_SYMBOLIC = + +# These libraries are platform-specific, not system-specific +# WARNING Don't use the -thread option, use -pthread option +PLATFORM_LIB += $(PRE_PLATFORM_LIB) pthread dl resolv stdc++ + +JNI_MD_NAME = darwin +JNI_MD_SYSNAME = i386 +JNI_MD_SYSNAME64 = amd64 +SETUPSDK_JNIDIR = Unix/Linux/X86 + +# Enables OS specific stats collection +#FEAT_PLATFORM_STATS=1 + +# force native threads to be used at build runtime +export THREADS_FLAG=native + +# Linux needs to be taken by the hand and told each and every directory +# where it might find libaries that other shared libs have dependencies to +LD_FLAGS += $(addprefix -L,$(LIBDIRS)) +LD_FLAGS += $(addprefix -L,$(LOCAL_LIBDIRS)) +LD_FLAGS += $(addprefix -L,$(SYSTEM_LIBDIRS)) + +# No support for mapfiles +USE_MAPFILE= + +# Add platform specific NSS modules +SECURITY_MODULE_LIBS += freebl3 + +DYNAMIC_LIB_SUFFIX=dylib +LD_LIB_VAR=DYLD_LIBRARY_PATH + +LDAPSDK_INC=-I/usr/local/include/mozldap +LDAPSDK_LIBDIR=/usr/local/lib/mozldap + +NSPR_INC=-I/opt/local/include/nspr +NSPR_LIBDIR=/opt/local/lib/nspr +NSS_INC=-I/opt/local/include/nss +NSS_LIBDIR=/opt/local/lib/nss +ZLIB_INC=/opt/local/include +ZLIB_LIBDIR=/opt/local/lib +XERCESC_INC=-I/opt/local/include +XERCESC_LIBDIR=/opt/local/lib +XALANC_INC=-I/opt/local/include +XALANC_LIBDIR=/opt/local/lib +PCRE_INC=-I/opt/local/include +PCRE_LIBDIR=/opt/local/lib +ICU_INC=-I/opt/local/include +ICU_LIBDIR=/opt/local/lib +SASL_INC=-I/opt/local/include +SASL_LIBDIR=/opt/local/lib + +# Construct platform specific LD_LIBRARY path component +PLATFORM_LIBPATH=$(NSS_LIBDIR):$(LDAPSDK_LIBDIR) diff -r 367e5999a90e make/rules___.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/rules___.mk Mon Jul 20 12:56:34 2009 +0530 @@ -0,0 +1,34 @@ +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright 2009 Sun Microsystems, Inc. All rights reserved. +# +# THE BSD LICENSE +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# Neither the name of the nor the names of its contributors may be +# used to endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +include $(BUILD_ROOT)/make/rules_x86_Linux_2.4.mk diff -r 367e5999a90e src/server/base/Makefile --- a/src/server/base/Makefile Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/Makefile Mon Jul 20 12:56:34 2009 +0530 @@ -59,6 +59,9 @@ ifeq ($(OS_ARCH),Linux) LOCAL_DEF+= -DUSE_POSIXFDPASSING endif +ifeq ($(OS_ARCH),Darwin) +LOCAL_DEF+= -DUSE_POSIXFDPASSING +endif AR_TARGET=libbase EXPORT_LIBRARIES=$(AR_TARGET) diff -r 367e5999a90e src/server/base/dll.cpp --- a/src/server/base/dll.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/dll.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -76,7 +76,11 @@ DllInitialize() { #if defined(DLL_DLOPEN) +#if defined(DARWIN) + char *name = PR_GetLibraryFilePathname("ns-httpd40", (PRFuncPtr)_dll_library); +#else char *name = PR_GetLibraryFilePathname(NULL, (PRFuncPtr)_dll_library); +#endif if (name) { int len = strlen(name); if (len >= PATH_MAX) diff -r 367e5999a90e src/server/base/dnsdmain.cpp --- a/src/server/base/dnsdmain.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/dnsdmain.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -72,7 +72,7 @@ #ifdef HPUX extern int gethostname (char *name, size_t namelen); #else -#if !defined(AIX) && !defined(IRIX) && !defined(LINUX) +#if !defined(AIX) && !defined(IRIX) && !defined(LINUX) && !defined(DARWIN) extern int gethostname (char *name, int namelen); #endif #endif diff -r 367e5999a90e src/server/base/net.cpp --- a/src/server/base/net.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/net.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -42,7 +42,7 @@ #include "netsite.h" -#ifdef Linux +#if defined(Linux) || defined(DARWIN) #include #endif diff -r 367e5999a90e src/server/base/systems.h --- a/src/server/base/systems.h Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/systems.h Mon Jul 20 12:56:34 2009 +0530 @@ -88,7 +88,7 @@ #ifdef HW_THREADS #define THREAD_ANY #endif -#elif defined(BSDI) +#elif defined(DARWIN) #define AUTH_DBM #define BSD_MAIL @@ -107,6 +107,10 @@ #define SEM_FLOCK #define SHMEM_MMAP_FLAGS MAP_SHARED #define JAVA_STATIC_LINK +#define SA_HANDLER_T(x) (void (*)(int))x +#define DLL_CAPABLE +#define DLL_DLOPEN +#define DLL_DLOPEN_FLAGS RTLD_NOW #elif defined(HPUX) diff -r 367e5999a90e src/server/base/util.cpp --- a/src/server/base/util.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/util.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -1990,7 +1990,7 @@ { struct passwd *rv; -#if defined(AIX) || defined(LINUX) || defined(HPUX) +#if defined(AIX) || defined(LINUX) || defined(HPUX) || defined(DARWIN) errno = getpwnam_r(name, result, buffer, buflen, &rv); if (errno != 0) rv = NULL; @@ -2011,7 +2011,7 @@ { struct passwd *rv; -#if defined(AIX) || defined(LINUX) || defined(HPUX) +#if defined(AIX) || defined(LINUX) || defined(HPUX) || defined(DARWIN) errno = getpwuid_r(uid, result, buffer, buflen, &rv); if (errno != 0) rv = NULL; diff -r 367e5999a90e src/server/base/wdservermessage.cpp --- a/src/server/base/wdservermessage.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/base/wdservermessage.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -182,7 +182,11 @@ msg.msg_name = NULL; msg.msg_namelen = 0; +#if defined(DARWIN) + iov[0].iov_base = (void *) &length; +#else iov[0].iov_base = (caddr_t) &length; +#endif iov[0].iov_len = sizeof(length); msg.msg_iov = iov; msg.msg_iovlen = 1; @@ -373,7 +377,11 @@ msg.msg_name = NULL; msg.msg_namelen = 0; +#if defined(DARWIN) + iov[0].iov_base = (void *) &dataLength; +#else iov[0].iov_base = (caddr_t) &dataLength; +#endif iov[0].iov_len = sizeof(dataLength); msg.msg_iov = iov; msg.msg_iovlen = 1; diff -r 367e5999a90e src/server/frame/aclframe.cpp --- a/src/server/frame/aclframe.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/frame/aclframe.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -48,7 +48,9 @@ #include "sys/types.h" #include +#ifndef DARWIN #include "malloc.h" +#endif #include "netsite.h" #ifdef XP_WIN32 #include "winsock.h" diff -r 367e5999a90e src/server/ldaputil/LinkedList.cpp --- a/src/server/ldaputil/LinkedList.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/LinkedList.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -205,7 +205,7 @@ // Explicitly instantiate a template to make sure that it and all member // functions will be part of a library. // -#if defined(XP_PC) || defined(HPUX) || defined(LINUX) +#if defined(XP_PC) || defined(HPUX) || defined(LINUX) || defined(DARWIN) // REVISIT: Added "class" before Clist for HPUX. // This should be O.K for NT also but need to double check. // mohideen@cup.hp.com diff -r 367e5999a90e src/server/ldaputil/cert.cpp --- a/src/server/ldaputil/cert.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/cert.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -33,7 +33,9 @@ #include +#ifndef DARWIN #include +#endif #include "base/systems.h" /* Pick up some defines so this stupid NSS headers will work */ #include "prmem.h" #include "key.h" diff -r 367e5999a90e src/server/ldaputil/certmap.cpp --- a/src/server/ldaputil/certmap.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/certmap.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -35,7 +35,9 @@ #include #include #include +#ifndef DARWIN #include +#endif #include #include #include "base/systems.h" /* Pick up some defines so this stupid NSS headers will work */ diff -r 367e5999a90e src/server/ldaputil/dbconf.cpp --- a/src/server/ldaputil/dbconf.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/ldaputil/dbconf.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -38,7 +38,9 @@ // #include +#ifndef DARWIN #include +#endif #include #include "base/util.h" diff -r 367e5999a90e src/server/libaccess/LdapRealm.cpp --- a/src/server/libaccess/LdapRealm.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/libaccess/LdapRealm.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -41,7 +41,9 @@ #include #endif #include +#ifndef DARWIN #include +#endif #include #include #include "ldaputil/LdapSessionPool.h" diff -r 367e5999a90e src/server/libaccess/cryptwrapper.cpp --- a/src/server/libaccess/cryptwrapper.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/libaccess/cryptwrapper.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -35,7 +35,11 @@ #include #include #if !defined (XP_WIN32) +#if defined(DARWIN) +#include +#else #include +#endif #else extern "C" char *crypt(const char *key, const char *salt); #endif diff -r 367e5999a90e src/server/plugins/fastcgi/fastcgistub.cpp --- a/src/server/plugins/fastcgi/fastcgistub.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/server/plugins/fastcgi/fastcgistub.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -45,7 +45,7 @@ #include #include - #if !defined(LINUX) + #if !defined(LINUX) && !defined(DARWIN) #include #endif @@ -57,7 +57,7 @@ #include #include - #if defined(HPUX) || defined(AIX) + #if defined(HPUX) || defined(AIX) || defined(DARWIN) #include #else #include diff -r 367e5999a90e src/server/plugins/htaccess/htpasswd.c --- a/src/server/plugins/htaccess/htpasswd.c Thu May 07 03:20:10 2009 -0700 +++ b/src/server/plugins/htaccess/htpasswd.c Mon Jul 20 12:56:34 2009 +0530 @@ -44,7 +44,9 @@ #include #if !defined (XP_WIN32) +#if !defined(DARWIN) #include +#endif #include #else #include diff -r 367e5999a90e src/server/safs/Cgistub.c --- a/src/server/safs/Cgistub.c Thu May 07 03:20:10 2009 -0700 +++ b/src/server/safs/Cgistub.c Mon Jul 20 12:56:34 2009 +0530 @@ -59,7 +59,7 @@ #if defined(SOLARIS) #include /* dlopen */ #endif -#if !defined(LINUX) +#if !defined(LINUX) && !defined(DARWIN) #include #endif #if !defined(USE_CONNLD) @@ -67,7 +67,7 @@ #endif #include #include -#if defined(HPUX) || defined(AIX) +#if defined(HPUX) || defined(AIX) || defined(DARWIN) #include #else #include diff -r 367e5999a90e src/server/safs/Makefile --- a/src/server/safs/Makefile Thu May 07 03:20:10 2009 -0700 +++ b/src/server/safs/Makefile Mon Jul 20 12:56:34 2009 +0530 @@ -60,6 +60,10 @@ LOCAL_DEF+= -DUSE_POSIXFDPASSING endif +ifeq ($(OS_ARCH),Darwin) +LOCAL_DEF+= -DUSE_POSIXFDPASSING +endif + AR_OBJS=$(SAFSOBJS) ifneq ($(OS_ARCH),WINNT) diff -r 367e5999a90e src/server/safs/Makefile.cgistub --- a/src/server/safs/Makefile.cgistub Thu May 07 03:20:10 2009 -0700 +++ b/src/server/safs/Makefile.cgistub Mon Jul 20 12:56:34 2009 +0530 @@ -79,6 +79,9 @@ ifeq ($(OS_ARCH),Linux) C_FLAGS += -DLINUX -DUSE_POSIXFDPASSING endif +ifeq ($(OS_ARCH),Darwin) +C_FLAGS += -DUSE_POSIXFDPASSING -DDARWIN +endif all:: diff -r 367e5999a90e src/support/ares/arlib.h --- a/src/support/ares/arlib.h Thu May 07 03:20:10 2009 -0700 +++ b/src/support/ares/arlib.h Mon Jul 20 12:56:34 2009 +0530 @@ -37,6 +37,10 @@ #include #include #include +#if defined(DARWIN) +#include +#endif + //const PRInt32 MAXDNAME = 256; //const PRInt32 HFIXEDSZ = 12; #include diff -r 367e5999a90e src/support/filecache/Makefile --- a/src/support/filecache/Makefile Thu May 07 03:20:10 2009 -0700 +++ b/src/support/filecache/Makefile Mon Jul 20 12:56:34 2009 +0530 @@ -56,6 +56,10 @@ LOCAL_LIBDIRS+=../version/$(OBJDIR) LOCAL_LIBDIRS+=../time/$(OBJDIR) +ifeq ($(OS_ARCH),Darwin) +LOCAL_LIBDIRS+=../xp/$(OBJDIR) +LOCAL_LIB+=xp +endif LOCAL_INC +=-I. -I.. LOCAL_INC +=-I../version LOCAL_DEF += -DBUILD_NSFC_DLL diff -r 367e5999a90e src/support/filecache/md_unix.cpp --- a/src/support/filecache/md_unix.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/support/filecache/md_unix.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -42,6 +42,9 @@ */ #include "nsfc_pvt.h" +#if defined(DARWIN) +#include +#endif static PRInt64 __MDEntry_Transmit(PRFileDesc *socket, NSFCMDEntry *md, NSFCFileInfo *finfo, diff -r 367e5999a90e src/support/libdbm/h_lock.c --- a/src/support/libdbm/h_lock.c Thu May 07 03:20:10 2009 -0700 +++ b/src/support/libdbm/h_lock.c Mon Jul 20 12:56:34 2009 +0530 @@ -47,6 +47,10 @@ #include #endif +#if defined(DARWIN) +#include +#include +#endif #include #include #include "nspr.h" /* NSPR threads declarations */ diff -r 367e5999a90e src/support/libdbm/mcom_db.h --- a/src/support/libdbm/mcom_db.h Thu May 07 03:20:10 2009 -0700 +++ b/src/support/libdbm/mcom_db.h Mon Jul 20 12:56:34 2009 +0530 @@ -159,7 +159,7 @@ #include #endif -#ifndef macintosh +#ifndef DARWIN #include #endif @@ -214,7 +214,7 @@ #include #endif -#if !defined(_WINDOWS) && !defined(macintosh) +#if !defined(_WINDOWS) && !defined(DARWIN) #include #include #endif diff -r 367e5999a90e src/support/libdbm/nsres.c --- a/src/support/libdbm/nsres.c Thu May 07 03:20:10 2009 -0700 +++ b/src/support/libdbm/nsres.c Mon Jul 20 12:56:34 2009 +0530 @@ -31,17 +31,26 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifdef DARWIN +#include +#endif #include "nsres.h" +#ifndef DARWIN #include +#endif #ifdef BSDI #include #else +#ifndef DARWIN #include #endif +#endif +#ifndef DARWIN #include #include +#endif enum { diff -r 367e5999a90e src/support/xp/_xpatomic_darwin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/support/xp/_xpatomic_darwin.h Mon Jul 20 12:56:34 2009 +0530 @@ -0,0 +1,55 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * THE BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of the nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * _xpatomic_darwin.h + * + * Atomic operation inlines for MAC. + */ + +#ifndef _XP_XPATOMIC_H +#error This file should only be included by xpatomic.h +#endif + +#include "_xpatomic_locked.h" +#include + +XP_INLINE void XP_ProducerMemoryBarrier(void) +{ + OSMemoryBarrier(); +} + +XP_INLINE void XP_ConsumerMemoryBarrier(void) +{ + OSMemoryBarrier(); +} diff -r 367e5999a90e src/support/xp/xpatomic.cpp --- a/src/support/xp/xpatomic.cpp Thu May 07 03:20:10 2009 -0700 +++ b/src/support/xp/xpatomic.cpp Mon Jul 20 12:56:34 2009 +0530 @@ -212,7 +212,7 @@ #define NUM_UNIT_TEST_THREADS 4 #define NUM_UNIT_TEST_ITERATIONS 16384 -#if defined(LINUX) || defined(AIX) +#if defined(LINUX) || defined(AIX) || defined(DARWIN) #define CONST_VALUE(x) x##LL #else #define CONST_VALUE(x) x diff -r 367e5999a90e src/support/xp/xpatomic.h --- a/src/support/xp/xpatomic.h Thu May 07 03:20:10 2009 -0700 +++ b/src/support/xp/xpatomic.h Mon Jul 20 12:56:34 2009 +0530 @@ -48,6 +48,8 @@ #endif #if defined(_MSC_VER) #include "_xpatomic_msvc.h" +#elif defined(DARWIN) +#include "_xpatomic_darwin.h" #elif defined(__GNUC__) #include "_xpatomic_gcc.h" #elif defined(__SUNPRO_CC)