summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixPort.h
diff options
context:
space:
mode:
authordas <das>2006-07-20 06:21:41 (GMT)
committerdas <das>2006-07-20 06:21:41 (GMT)
commitbed796e06772e11d807d9394771ef16cf766b2cd (patch)
tree87aa93a682398fe04c4b734c7ea00049bf6fba02 /unix/tclUnixPort.h
parent8cb60c333409bcc5ab4d0388905e7840b41422b2 (diff)
downloadtcl-bed796e06772e11d807d9394771ef16cf766b2cd.zip
tcl-bed796e06772e11d807d9394771ef16cf766b2cd.tar.gz
tcl-bed796e06772e11d807d9394771ef16cf766b2cd.tar.bz2
* macosx/tclMacOSXNotify.c (Tcl_InitNotifier, Tcl_WaitForEvent): create
notifier thread lazily upon first call to Tcl_WaitForEvent() rather than in Tcl_InitNotifier(). Allows calling exeve() in processes where the event loop has not yet been run (Darwin's execve() fails in processes with more than one thread), in particular allows embedders to call fork() followed by execve(), previously the pthread_atfork() child handler's call to Tcl_InitNotifier() would immediately recreate the notifier thread in the child after a fork. * macosx/tclMacOSXNotify.c (Tcl_InitNotifier): add support for * unix/tclUnixFCmd.c (DoRenameFile, CopyFileAtts): weakly importing * unix/tclUnixInit.c (TclpSetInitialEncodings): symbols not available on OSX 10.2 or 10.3, enables binaires built on later OSX versions to run on earlier ones. * macosx/README: document how to enable weak-linking; cleanup. * unix/tclUnixPort.h: add support for weak-linking; conditionalize AvailabilityMacros.h inclusion; only disable realpath on 10.2 or earlier when threads are enabled. * unix/tclLoadDyld.c (TclpLoadMemoryGetBuffer): change runtime Darwin * unix/tclUnixInit.c (TclpInitPlatform): release check to use global initialized once. * unix/tclUnixFCmd.c (DoRenameFile, TclpObjNormalizePath): add runtime Darwin release check to determine if realpath is threadsafe. * unix/configure.in: add check on Darwin for compiler support of weak * unix/tcl.m4: import and for AvailabilityMacros.h header; move Darwin specific checks & defines that are only relevant to the tcl build out of tcl.m4; restrict framework option to Darwin; cleanup quoting. * unix/configure: autoconf-2.13 * unix/tclLoadDyld.c (TclpLoadMemory): * unix/tclUnixPipe.c (TclpCreateProcess): fix signed-with-unsigned comparison and other warnings from gcc4 -Wextra.
Diffstat (limited to 'unix/tclUnixPort.h')
-rw-r--r--unix/tclUnixPort.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index 0fa3803..023cad4 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -19,7 +19,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixPort.h,v 1.27.2.11 2006/07/14 16:20:23 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclUnixPort.h,v 1.27.2.12 2006/07/20 06:21:46 das Exp $
*/
#ifndef _TCLUNIXPORT
@@ -509,11 +509,6 @@ extern double strtod();
*/
#ifdef __APPLE__
-/*
- * Translate the symbolic values for MAC_OS_X_VERSION_MAX_ALLOWED to
- * the numbers used in the comparisons below.
- */
-#include <AvailabilityMacros.h>
/*
* Support for fat compiles: configure runs only once for multiple architectures
*/
@@ -531,6 +526,25 @@ extern double strtod();
# undef USE_TERMIO
# undef USE_SGTTY
# endif /* __DARWIN_UNIX03 */
+/*
+ * Include AvailabilityMacros.h here (when available) to ensure any symbolic
+ * MAC_OS_X_VERSION_* constants passed on the command line are translated.
+ */
+# ifdef HAVE_AVAILABILITYMACROS_H
+# include <AvailabilityMacros.h>
+# endif
+/*
+ * Support for weak import.
+ */
+# ifdef HAVE_WEAK_IMPORT
+# if !defined(HAVE_AVAILABILITYMACROS_H) || !defined(MAC_OS_X_VERSION_MIN_REQUIRED)
+# undef HAVE_WEAK_IMPORT
+# else
+# ifndef WEAK_IMPORT_ATTRIBUTE
+# define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
+# endif
+# endif
+# endif /* HAVE_WEAK_IMPORT */
/*
* Support for MAC_OS_X_VERSION_MAX_ALLOWED define from AvailabilityMacros.h:
* only use API available in the indicated OS version or earlier.
@@ -542,14 +556,17 @@ extern double strtod();
# undef HAVE_COPYFILE
# endif
# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
-# define NO_REALPATH 1
+# ifdef TCL_THREADS
+ /* prior to 10.3, realpath is not threadsafe, c.f. bug 711232 */
+# define NO_REALPATH 1
+# endif
# undef HAVE_LANGINFO
# endif
# endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
#endif /* __APPLE__ */
/*
- * Darwin 8 copyfile API
+ * Darwin 8 copyfile API.
*/
#ifdef HAVE_COPYFILE
@@ -560,8 +577,14 @@ int copyfile(const char *from, const char *to, void *state, uint32_t flags);
#define COPYFILE_ACL (1<<0)
#define COPYFILE_XATTR (1<<2)
#define COPYFILE_NOFOLLOW_SRC (1<<18)
-#endif
-#endif
+#endif /* HAVE_COPYFILE_H */
+#if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1040
+/* Support for weakly importing copyfile. */
+#define WEAK_IMPORT_COPYFILE
+extern int copyfile(const char *from, const char *to, void *state,
+ uint32_t flags) WEAK_IMPORT_ATTRIBUTE;
+#endif /* HAVE_WEAK_IMPORT */
+#endif /* HAVE_COPYFILE */
/*
*---------------------------------------------------------------------------