Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mapserver/mapserver
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed May 23, 2012
2 parents ad2775b + ddbeb3b commit 2649e84
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
33 changes: 33 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -19294,6 +19294,39 @@ THREAD_LIB=$THREAD_LIB
ALL_ENABLED="$THREAD_FLAG $ALL_ENABLED"
ALL_LIB="$THREAD_LIB $ALL_LIB"

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __sync_fetch_and_add" >&5
$as_echo_n "checking for __sync_fetch_and_add... " >&6; }
if test "${ac_cv_func_sync_fetch_and_add+set}" = set; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{
int x;__sync_fetch_and_add(&x,1);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_func_sync_fetch_and_add=yes
else
ac_cv_func_sync_fetch_and_add=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_sync_fetch_and_add" >&5
$as_echo "$ac_cv_func_sync_fetch_and_add" >&6; }
if test "$ac_cv_func_sync_fetch_and_add" = yes; then
ALL_ENABLED="-DHAVE_SYNC_FETCH_AND_ADD $ALL_ENABLED"

$as_echo "#define HAVE_SYNC_FETCH_AND_ADD 1" >>confdefs.h

fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we should include ESRI SDE support..." >&5
$as_echo "$as_me: checking whether we should include ESRI SDE support..." >&6;}
Expand Down
10 changes: 10 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,16 @@ AC_SUBST(THREAD_LIB,$THREAD_LIB)
ALL_ENABLED="$THREAD_FLAG $ALL_ENABLED"
ALL_LIB="$THREAD_LIB $ALL_LIB"

dnl ---------------------------------------------------------------------
dnl Check for the __sync_fetch_and_add builtin
dnl ---------------------------------------------------------------------
AC_CACHE_CHECK([for __sync_fetch_and_add], ac_cv_func_sync_fetch_and_add,
[AC_TRY_LINK([],[int x;__sync_fetch_and_add(&x,1);],ac_cv_func_sync_fetch_and_add=yes,ac_cv_func_sync_fetch_and_add=no)])
if test "$ac_cv_func_sync_fetch_and_add" = yes; then
ALL_ENABLED="-DHAVE_SYNC_FETCH_AND_ADD $ALL_ENABLED"
AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD,1,[Define if you have the __sync_fetch_and_add function])
fi

dnl ---------------------------------------------------------------------
dnl Find ESRI SDE ONLY IF REQUESTED.
dnl ---------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion mapserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ MS_DLL_EXPORT int msImageSetPenGD(gdImagePtr img, colorObj *color);
#define GET_LAYER(map, pos) map->layers[pos]
#define GET_CLASS(map, lid, cid) map->layers[lid]->class[cid]

#if defined(USE_THREAD) && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) >= 40102
#if defined(USE_THREAD) && defined(HAVE_SYNC_FETCH_AND_ADD)

// __sync* appeared in GCC 4.1.2
#define MS_REFCNT_INCR(obj) __sync_fetch_and_add(&obj->refcount, +1)
Expand Down

0 comments on commit 2649e84

Please sign in to comment.