mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-30 02:47:56 +08:00
compile ok for centos5.x
This commit is contained in:
parent
4ac182fdce
commit
d5fe28dd8f
@ -30,7 +30,9 @@ int acl_secure_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap);
|
|||||||
# ifndef _GNU_SOURCE
|
# ifndef _GNU_SOURCE
|
||||||
# define _GNU_SOURCE
|
# define _GNU_SOURCE
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef __USE_UNIX98
|
||||||
|
# define __USE_UNIX98
|
||||||
|
# endif
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
|
@ -18,6 +18,12 @@
|
|||||||
#elif defined(ACL_UNIX)
|
#elif defined(ACL_UNIX)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
#endif
|
||||||
|
#ifndef __USE_UNIX98
|
||||||
|
# define __USE_UNIX98
|
||||||
|
#endif
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -113,7 +119,7 @@ static void init_log_mutex(acl_pthread_mutex_t *lock)
|
|||||||
pthread_mutexattr_t attr;
|
pthread_mutexattr_t attr;
|
||||||
|
|
||||||
n1 = pthread_mutexattr_init(&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);
|
thread_mutex_init(lock, !n1 && !n2 ? &attr : NULL);
|
||||||
#else
|
#else
|
||||||
thread_mutex_init(lock, NULL);
|
thread_mutex_init(lock, NULL);
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
# ifndef _GNU_SOURCE
|
# ifndef _GNU_SOURCE
|
||||||
# define _GNU_SOURCE
|
# define _GNU_SOURCE
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef __USE_UNIX98
|
||||||
|
# define __USE_UNIX98
|
||||||
|
# endif
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user