Skip to content

Commit

Permalink
unix: fix GNU-ism introduced in edd1007
Browse files Browse the repository at this point in the history
Don't use features.h, it's only available on GNU/glibc systems.
  • Loading branch information
bnoordhuis committed Jan 7, 2013
1 parent f24335d commit cb3c448
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/unix/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <features.h>

static int uv__async_init(uv_loop_t* loop);
static void uv__async_io(uv_loop_t* loop, uv__io_t* w, unsigned int events);
Expand All @@ -51,7 +50,7 @@ static int uv__async_make_pending(volatile sig_atomic_t* ptr) {
__asm__ __volatile__("xchgl %0, %1" : "+r" (val) : "m" (*ptr));
return val != 0;
}
#elif defined(__GNUC_PREREQ) && __GNUC_PREREQ(4, 1)
#elif defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 0)
return __sync_val_compare_and_swap(ptr, 0, 1) != 0;
#else
*ptr = 1;
Expand Down

0 comments on commit cb3c448

Please sign in to comment.