Skip to content

Commit

Permalink
build: check for solaris pthreads, which mess up macros.
Browse files Browse the repository at this point in the history
also check for posix_memalign() and memalign().
  • Loading branch information
Christian Hergert authored and chergert committed Oct 18, 2013
1 parent 505d133 commit 7393ca6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bson/bson-context.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,21 @@ bson_context_init_default (void)
bson_context_t *
bson_context_get_default (void)
{
/*
* TODO: This should be done in our thread abstraction.
*/

#ifdef SOLARIS_PTHREADS
/*
* How lovely of solaris (and I think Irix) to do this to posix
* macros. Ugh.
*/
static pthread_once_t once = {PTHREAD_ONCE_INIT};
#else
static pthread_once_t once = PTHREAD_ONCE_INIT;
#endif

pthread_once(&once, bson_context_init_default);

return gContextDefault;
}
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ AS_CASE([$host],
[*-*-solaris*],
[
platform_solaris=yes
CFLAGS="$CFLAGS -DSOLARIS_PTHREADS"
],

[]
Expand Down

0 comments on commit 7393ca6

Please sign in to comment.