From b7047d6701db85d5d074ed4e081a31f3928e6a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 13 Sep 2012 00:46:49 +0200 Subject: [PATCH] unix: remove __read_mostly macro It creates trouble with llvm-gcc on OS X. --- src/unix/core.c | 2 +- src/unix/internal.h | 7 ++----- src/unix/process.c | 4 ++-- src/unix/stream.c | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/unix/core.c b/src/unix/core.c index 85d5f1644..3ad63f1f8 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -463,7 +463,7 @@ int uv__accept(int sockfd) { while (1) { #if __linux__ - static __read_mostly int no_accept4; + static int no_accept4; if (no_accept4) goto skip; diff --git a/src/unix/internal.h b/src/unix/internal.h index fa7fd2355..4abfedde3 100644 --- a/src/unix/internal.h +++ b/src/unix/internal.h @@ -28,11 +28,8 @@ #include #include /* abort */ -#if defined(__GNUC__) -# define __read_mostly __attribute__((__section__(".data.read_mostly"))) -#else -# define __attribute__(v) -# define __read_mostly +#if defined(__STRICT_ANSI__) +# define inline __inline #endif #undef HAVE_FUTIMES diff --git a/src/unix/process.c b/src/unix/process.c index 829f79aaf..7c552a736 100644 --- a/src/unix/process.c +++ b/src/unix/process.c @@ -117,7 +117,7 @@ static void uv__chld(uv_signal_t* handle, int signum) { int uv__make_socketpair(int fds[2], int flags) { #if __linux__ - static __read_mostly int no_cloexec; + static int no_cloexec; if (no_cloexec) goto skip; @@ -153,7 +153,7 @@ skip: int uv__make_pipe(int fds[2], int flags) { #if __linux__ - static __read_mostly int no_pipe2; + static int no_pipe2; if (no_pipe2) goto skip; diff --git a/src/unix/stream.c b/src/unix/stream.c index 9e0047404..5321d90f4 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -440,7 +440,7 @@ static int uv__emfile_trick(uv_loop_t* loop, int accept_fd) { void uv__server_io(uv_loop_t* loop, uv__io_t* w, int events) { - static __read_mostly int use_emfile_trick = -1; + static int use_emfile_trick = -1; uv_stream_t* stream; int fd; int r;