From d5fe28dd8f8f55f96573db11500608810d765cb5 Mon Sep 17 00:00:00 2001 From: zhengshuxin Date: Mon, 11 Sep 2017 11:38:06 +0800 Subject: [PATCH] compile ok for centos5.x --- lib_acl/StdAfx.h | 4 +++- lib_acl/src/stdlib/acl_mylog.c | 8 +++++++- lib_acl/src/stdlib/memory/acl_mempool.c | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib_acl/StdAfx.h b/lib_acl/StdAfx.h index 359eb620b..178af4f4c 100644 --- a/lib_acl/StdAfx.h +++ b/lib_acl/StdAfx.h @@ -30,7 +30,9 @@ int acl_secure_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap); # ifndef _GNU_SOURCE # define _GNU_SOURCE # endif - +# ifndef __USE_UNIX98 +# define __USE_UNIX98 +# endif # include # include # include diff --git a/lib_acl/src/stdlib/acl_mylog.c b/lib_acl/src/stdlib/acl_mylog.c index 72b77ad2e..8e1e6031e 100644 --- a/lib_acl/src/stdlib/acl_mylog.c +++ b/lib_acl/src/stdlib/acl_mylog.c @@ -18,6 +18,12 @@ #elif defined(ACL_UNIX) #include #include +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#ifndef __USE_UNIX98 +# define __USE_UNIX98 +#endif #include #include #include @@ -113,7 +119,7 @@ static void init_log_mutex(acl_pthread_mutex_t *lock) pthread_mutexattr_t attr; n1 = pthread_mutexattr_init(&attr); - n2 = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + n2 = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); thread_mutex_init(lock, !n1 && !n2 ? &attr : NULL); #else thread_mutex_init(lock, NULL); diff --git a/lib_acl/src/stdlib/memory/acl_mempool.c b/lib_acl/src/stdlib/memory/acl_mempool.c index abbd7ea53..f3f1a85e6 100644 --- a/lib_acl/src/stdlib/memory/acl_mempool.c +++ b/lib_acl/src/stdlib/memory/acl_mempool.c @@ -20,6 +20,9 @@ # ifndef _GNU_SOURCE # define _GNU_SOURCE # endif +# ifndef __USE_UNIX98 +# define __USE_UNIX98 +# endif # include #endif