[libxml2] Change preprocessor OS tests to __linux__
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Change preprocessor OS tests to __linux__
- Date: Thu, 14 Sep 2017 19:48:20 +0000 (UTC)
commit 2cdaaab11ce3fc855361b3267bc25fe3b9fa1f6f
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Thu Sep 14 21:30:51 2017 +0200
Change preprocessor OS tests to __linux__
"linux" without leading underscores is deprecated and less reliable.
.travis.yml | 2 +-
elfgcchack.h | 2 +-
libxml.h | 2 +-
nanohttp.c | 2 +-
threads.c | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/.travis.yml b/.travis.yml
index 5975976..6055b9a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,7 @@ matrix:
# GNU extensions as possible. -Dlinux is required to make the weak
# pthread symbols work.
- compiler: gcc
- env: CFLAGS="-O2 -std=c89 -D_POSIX_C_SOURCE=200809L -Dlinux"
+ env: CFLAGS="-O2 -std=c89 -D_POSIX_C_SOURCE=200809L"
# clang with AddressSanitizer and UndefinedBehaviorSanitizer.
- compiler: clang
dist: trusty
diff --git a/elfgcchack.h b/elfgcchack.h
index 8c52884..5ac93bf 100644
--- a/elfgcchack.h
+++ b/elfgcchack.h
@@ -11,7 +11,7 @@
#ifdef IN_LIBXML
#ifdef __GNUC__
#ifdef PIC
-#ifdef linux
+#ifdef __linux__
#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
#include "libxml/c14n.h"
diff --git a/libxml.h b/libxml.h
index 88e515f..f13e9de 100644
--- a/libxml.h
+++ b/libxml.h
@@ -101,7 +101,7 @@ int xmlNop(void);
#ifdef IN_LIBXML
#ifdef __GNUC__
#ifdef PIC
-#ifdef linux
+#ifdef __linux__
#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
#include "elfgcchack.h"
#endif
diff --git a/nanohttp.c b/nanohttp.c
index b911f9c..0533102 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -1130,7 +1130,7 @@ xmlNanoHTTPConnectHost(const char *host, int port)
* extraction code. it work on Linux, if it work on your platform
* and one want to enable it, send me the defined(foobar) needed
*/
-#if defined(HAVE_NETDB_H) && defined(HOST_NOT_FOUND) && defined(linux)
+#if defined(HAVE_NETDB_H) && defined(HOST_NOT_FOUND) && defined(__linux__)
const char *h_err_txt = "";
switch (h_errno) {
diff --git a/threads.c b/threads.c
index 8c57263..e52f263 100644
--- a/threads.c
+++ b/threads.c
@@ -48,7 +48,7 @@
static int libxml_is_threaded = -1;
#if defined(__GNUC__) && defined(__GLIBC__)
-#ifdef linux
+#ifdef __linux__
#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
#pragma weak pthread_once
#pragma weak pthread_getspecific
@@ -68,7 +68,7 @@ static int libxml_is_threaded = -1;
#pragma weak pthread_key_delete
#pragma weak pthread_cond_signal
#endif
-#endif /* linux */
+#endif /* __linux__ */
#endif /* defined(__GNUC__) && defined(__GLIBC__) */
#endif /* HAVE_PTHREAD_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]