Revision: 32 http://trac.macosforge.org/projects/libdispatch/changeset/32 Author: robert@fledge.watson.org Date: 2009-09-15 02:53:59 -0700 (Tue, 15 Sep 2009) Log Message: ----------- Detect when __private_extern__ isn't present on a platform and use a compatibility define. It's not clear "extern" this is the best possible substitute, so we may want to change it. Modified Paths: -------------- trunk/configure.ac trunk/src/internal.h Added Paths: ----------- trunk/compat/private_extern.h Added: trunk/compat/private_extern.h =================================================================== --- trunk/compat/private_extern.h (rev 0) +++ trunk/compat/private_extern.h 2009-09-15 09:53:59 UTC (rev 32) @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009 Apple Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ + +#ifndef __APPLE_H__ +#define __APPLE_H__ + +#define __private_extern__ extern + +#endif /* __APPLE_H__ */ Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2009-09-15 09:43:14 UTC (rev 31) +++ trunk/configure.ac 2009-09-15 09:53:59 UTC (rev 32) @@ -152,6 +152,16 @@ AC_CHECK_FUNCS([pthread_key_init_np mach_absolute_time malloc_create_zone sem_init]) # +# Does the platform support __private_extern__? There is surely a better way +# to check this. +# +AC_TRY_LINK([], [ + __private_extern__ int foo; +], [ + AC_DEFINE(HAVE_PRIVATE_EXTERN,, Define if __private_extern__ present) +]) + +# # Generate Makefiles. # AC_CONFIG_FILES([Makefile src/Makefile]) Modified: trunk/src/internal.h =================================================================== --- trunk/src/internal.h 2009-09-15 09:43:14 UTC (rev 31) +++ trunk/src/internal.h 2009-09-15 09:53:59 UTC (rev 32) @@ -41,6 +41,9 @@ #else #include <compat/Availability.h> #endif +#ifndef HAVE_PRIVATE_EXTERN +#include <compat/private_extern.h> +#endif #include "dispatch.h" #include "base.h"