Diff
Modified: trunk/configure.ac (193 => 194)
--- trunk/configure.ac 2010-10-24 08:36:30 UTC (rev 193)
+++ trunk/configure.ac 2010-12-23 01:35:54 UTC (rev 194)
@@ -182,6 +182,13 @@
)
#
+# Check if libpthread_workqueue.so exists
+#
+AC_CHECK_LIB(pthread_workqueue, pthread_workqueue_init_np,
+ have_lpwq=true, have_lpwq=false)
+AM_CONDITIONAL(USE_LIBPTHREAD_WORKQUEUE, $have_lpwq)
+
+#
# Find functions and declarations we care about.
#
AC_CHECK_DECLS([CLOCK_UPTIME, CLOCK_MONOTONIC, CLOCK_REALTIME], [], [],
@@ -193,7 +200,7 @@
AC_CHECK_DECLS([SIGEMT], [], [], [[#include <signal.h>]])
AC_CHECK_DECLS([VQ_UPDATE, VQ_VERYLOWDISK], [], [], [[#include <sys/mount.h>]])
AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
-AC_CHECK_FUNCS([pthread_key_init_np pthread_main_np mach_absolute_time malloc_create_zone sysconf getprogname])
+AC_CHECK_FUNCS([pthread_key_init_np pthread_main_np mach_absolute_time malloc_create_zone sysconf getprogname getexecname])
AC_CHECK_DECLS([POSIX_SPAWN_START_SUSPENDED],
[have_posix_spawn_start_suspended=true],
Modified: trunk/libdispatch.xcodeproj/project.pbxproj (193 => 194)
--- trunk/libdispatch.xcodeproj/project.pbxproj 2010-10-24 08:36:30 UTC (rev 193)
+++ trunk/libdispatch.xcodeproj/project.pbxproj 2010-12-23 01:35:54 UTC (rev 194)
@@ -328,7 +328,14 @@
isa = PBXProject;
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "libdispatch" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 08FB7794FE84155DC02AAC07 /* libdispatch */;
projectDirPath = "";
projectRoot = "";
@@ -403,7 +410,10 @@
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = NO;
GCC_OPTIMIZATION_LEVEL = s;
- GCC_PREPROCESSOR_DEFINITIONS = "__DARWIN_NON_CANCELABLE=1";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DISPATCH_NO_LEGACY=1",
+ "__DARWIN_NON_CANCELABLE=1",
+ );
GENERATE_MASTER_OBJECT_FILE = NO;
INSTALL_PATH = /usr/local/lib/system;
LINK_WITH_STANDARD_LIBRARIES = NO;
Modified: trunk/m4/private-extern.m4 (193 => 194)
--- trunk/m4/private-extern.m4 2010-10-24 08:36:30 UTC (rev 193)
+++ trunk/m4/private-extern.m4 2010-12-23 01:35:54 UTC (rev 194)
@@ -4,10 +4,12 @@
#
AC_DEFUN([DISPATCH_C_PRIVATE_EXTERN], [
+AC_LANG_WERROR
+
AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
dispatch_cv_hidden_visibility_attribute, [
- AC_TRY_LINK([],
- [extern __attribute__ ((visibility ("hidden"))) int foo;],
+ AC_TRY_LINK([int foo; extern __attribute__ ((visibility ("hidden"))) int foo;],
+ [foo = 0;],
[dispatch_cv_hidden_visibility_attribute=yes],
[dispatch_cv_hidden_visibility_attribute=no])])
Modified: trunk/src/Makefile.am (193 => 194)
--- trunk/src/Makefile.am 2010-10-24 08:36:30 UTC (rev 193)
+++ trunk/src/Makefile.am 2010-12-23 01:35:54 UTC (rev 194)
@@ -36,6 +36,10 @@
libdispatch_la_LIBADD=libshims.la $(KQUEUE_LIBS)
libdispatch_la_DEPENDENCIES=libshims.la
+if USE_LIBPTHREAD_WORKQUEUE
+libdispatch_la_LIBADD+=-lpthread_workqueue
+endif
+
if USE_MIG
libdispatch_la_SOURCES+= \
protocolUser.c \
Modified: trunk/src/queue.c (193 => 194)
--- trunk/src/queue.c 2010-10-24 08:36:30 UTC (rev 193)
+++ trunk/src/queue.c 2010-12-23 01:35:54 UTC (rev 194)
@@ -1206,7 +1206,7 @@
#endif
#if HAVE_PTHREAD_WORKQUEUES
} else {
- dispatch_assume(_dispatch_root_queue_contexts[i].dgq_kworkqueue);
+ (void)dispatch_assume(_dispatch_root_queue_contexts[i].dgq_kworkqueue);
}
#endif
}
Modified: trunk/src/shims/getprogname.h (193 => 194)
--- trunk/src/shims/getprogname.h 2010-10-24 08:36:30 UTC (rev 193)
+++ trunk/src/shims/getprogname.h 2010-12-23 01:35:54 UTC (rev 194)
@@ -23,15 +23,19 @@
#define __DISPATCH_SHIMS_GETPROGNAME__
#ifndef HAVE_GETPROGNAME
-static inline char *
+
+static inline const char *
getprogname(void)
{
# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
return program_invocation_short_name;
+#elif HAVE_GETEXECNAME
+ return getexecname();
# else
# error getprogname(3) is not available on this platform
# endif
}
+
#endif /* HAVE_GETPROGNAME */
#endif /* __DISPATCH_SHIMS_GETPROGNAME__ */
Modified: trunk/src/shims/time.c (193 => 194)
--- trunk/src/shims/time.c 2010-10-24 08:36:30 UTC (rev 193)
+++ trunk/src/shims/time.c 2010-12-23 01:35:54 UTC (rev 194)
@@ -37,6 +37,10 @@
dispatch_assume(QueryPerformanceFrequency(&freq));
_dispatch_host_time_data.frac = (long double)NSEC_PER_SEC / (long double)freq.QuadPart;
_dispatch_host_time_data.ratio_1_to_1 = (freq.QuadPart == 1);
-#endif /* TARGET_OS_WIN32 */
+#else // TARGET_OS_WIN32
+ _dispatch_host_time_data.frac = 1.0;
+ _dispatch_host_time_data.ratio_1_to_1 = 1;
+#endif
}
+
#endif
Modified: trunk/testing/dispatch_after.c (193 => 194)
--- trunk/testing/dispatch_after.c 2010-10-24 08:36:30 UTC (rev 193)
+++ trunk/testing/dispatch_after.c 2010-12-23 01:35:54 UTC (rev 194)
@@ -29,7 +29,7 @@
#include "dispatch_test.h"
#include <Block.h>
-void done(void *arg __unused) {
+void done(void *arg __attribute__((unused))) {
sleep(1);
test_stop();
}