summaryrefslogtreecommitdiffstats
path: root/macosx/tclMacOSXNotify.c
diff options
context:
space:
mode:
authordas <das>2007-01-19 01:03:58 (GMT)
committerdas <das>2007-01-19 01:03:58 (GMT)
commit34a3970c39dead78485d1bd7b7f4b858922c8f69 (patch)
tree8c889dd8b584c804f47a564d9fc3ed74243866d6 /macosx/tclMacOSXNotify.c
parent79321316d659aa0a2e5790798db88d38b8a9a835 (diff)
downloadtcl-34a3970c39dead78485d1bd7b7f4b858922c8f69.zip
tcl-34a3970c39dead78485d1bd7b7f4b858922c8f69.tar.gz
tcl-34a3970c39dead78485d1bd7b7f4b858922c8f69.tar.bz2
* macosx/tclMacOSXFCmd.c (TclMacOSXSetFileAttribute): on some versions
of Mac OS X, truncate() fails on resource forks, in that case use open() with O_TRUNC instead. * macosx/tclMacOSXNotify.c: accommodate changes to prototypes of OSSpinLock(Un)Lock API. * macosx/Tcl.xcodeproj/project.pbxproj: ensure HOME and USER env vars * macosx/Tcl.xcodeproj/default.pbxuser: are defined when running testsuite from Xcode. * tests/env.test: add extra system env vars that need to be preserved on some Mac OS X versions for testsuite to work. * unix/Makefile.in: move libtommath defines into configure.in to avoid * unix/configure.in: replicating them across multiple buildsystems. * macosx/Tcl.xcodeproj/project.pbxproj: * unix/tcl.m4: ensure CPPFLAGS env var is used when set. [Bug 1586861] (Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when present in CFLAGS to avoid discrepancies between what headers configure sees during preprocessing tests and compiling tests. * unix/configure: autoconf-2.59 * unix/tclConfig.h.in: autoheader-2.59
Diffstat (limited to 'macosx/tclMacOSXNotify.c')
-rw-r--r--macosx/tclMacOSXNotify.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c
index 23b858b..af2fa65 100644
--- a/macosx/tclMacOSXNotify.c
+++ b/macosx/tclMacOSXNotify.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.11 2006/08/21 03:50:50 das Exp $
+ * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.12 2007/01/19 01:03:59 das Exp $
*/
#include "tclInt.h"
@@ -168,12 +168,18 @@ static int receivePipe = -1; /* Output end of triggerPipe */
* Support for weakly importing spinlock API.
*/
#define WEAK_IMPORT_SPINLOCKLOCK
-extern void OSSpinLockLock(OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE;
-extern void OSSpinLockUnlock(OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE;
-extern void _spin_lock(OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE;
-extern void _spin_unlock(OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE;
-static void (* lockLock)(OSSpinLock *lock) = NULL;
-static void (* lockUnlock)(OSSpinLock *lock) = NULL;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+#define VOLATILE volatile
+#else
+#define VOLATILE
+#endif
+extern void OSSpinLockLock(VOLATILE OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE;
+extern void OSSpinLockUnlock(VOLATILE OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE;
+extern void _spin_lock(VOLATILE OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE;
+extern void _spin_unlock(VOLATILE OSSpinLock *lock) WEAK_IMPORT_ATTRIBUTE;
+static void (* lockLock)(VOLATILE OSSpinLock *lock) = NULL;
+static void (* lockUnlock)(VOLATILE OSSpinLock *lock) = NULL;
+#undef VOLATILE
static pthread_once_t spinLockLockInitControl = PTHREAD_ONCE_INIT;
static void SpinLockLockInit(void) {
lockLock = OSSpinLockLock != NULL ? OSSpinLockLock : _spin_lock;