mirror of
https://github.com/nginx/nginx.git
synced 2025-06-08 02:02:38 +08:00
try to use C99 variadic macros first:
AIX 5.3's XL C has problems with GCC style variadic macros
This commit is contained in:
parent
ee37271a0f
commit
802bc23574
26
auto/cc/conf
26
auto/cc/conf
@ -143,19 +143,6 @@ if [ "$NGX_PLATFORM" != win32 ]; then
|
|||||||
. auto/feature
|
. auto/feature
|
||||||
|
|
||||||
|
|
||||||
ngx_feature="gcc variadic macros"
|
|
||||||
ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
|
|
||||||
ngx_feature_run=yes
|
|
||||||
ngx_feature_incs="#include <stdio.h>
|
|
||||||
#define var(dummy, args...) sprintf(args)"
|
|
||||||
ngx_feature_path=
|
|
||||||
ngx_feature_libs=
|
|
||||||
ngx_feature_test="char buf[30]; buf[0] = '0';
|
|
||||||
var(0, buf, \"%d\", 1);
|
|
||||||
if (buf[0] != '1') return 1"
|
|
||||||
. auto/feature
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$NGX_CC_NAME" = "ccc" ]; then
|
if [ "$NGX_CC_NAME" = "ccc" ]; then
|
||||||
echo "checking for C99 variadic macros ... disabled"
|
echo "checking for C99 variadic macros ... disabled"
|
||||||
else
|
else
|
||||||
@ -173,6 +160,19 @@ if [ "$NGX_PLATFORM" != win32 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
ngx_feature="gcc variadic macros"
|
||||||
|
ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
|
||||||
|
ngx_feature_run=yes
|
||||||
|
ngx_feature_incs="#include <stdio.h>
|
||||||
|
#define var(dummy, args...) sprintf(args)"
|
||||||
|
ngx_feature_path=
|
||||||
|
ngx_feature_libs=
|
||||||
|
ngx_feature_test="char buf[30]; buf[0] = '0';
|
||||||
|
var(0, buf, \"%d\", 1);
|
||||||
|
if (buf[0] != '1') return 1"
|
||||||
|
. auto/feature
|
||||||
|
|
||||||
|
|
||||||
# ngx_feature="inline"
|
# ngx_feature="inline"
|
||||||
# ngx_feature_name=
|
# ngx_feature_name=
|
||||||
# ngx_feature_run=no
|
# ngx_feature_run=no
|
||||||
|
@ -68,23 +68,7 @@ struct ngx_log_s {
|
|||||||
|
|
||||||
/*********************************/
|
/*********************************/
|
||||||
|
|
||||||
#if (NGX_HAVE_GCC_VARIADIC_MACROS)
|
#if (NGX_HAVE_C99_VARIADIC_MACROS)
|
||||||
|
|
||||||
#define NGX_HAVE_VARIADIC_MACROS 1
|
|
||||||
|
|
||||||
#define ngx_log_error(level, log, args...) \
|
|
||||||
if ((log)->log_level >= level) ngx_log_error_core(level, log, args)
|
|
||||||
|
|
||||||
void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
|
|
||||||
const char *fmt, ...);
|
|
||||||
|
|
||||||
#define ngx_log_debug(level, log, args...) \
|
|
||||||
if ((log)->log_level & level) \
|
|
||||||
ngx_log_error_core(NGX_LOG_DEBUG, log, args)
|
|
||||||
|
|
||||||
/*********************************/
|
|
||||||
|
|
||||||
#elif (NGX_HAVE_C99_VARIADIC_MACROS)
|
|
||||||
|
|
||||||
#define NGX_HAVE_VARIADIC_MACROS 1
|
#define NGX_HAVE_VARIADIC_MACROS 1
|
||||||
|
|
||||||
@ -100,6 +84,22 @@ void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
|
|||||||
|
|
||||||
/*********************************/
|
/*********************************/
|
||||||
|
|
||||||
|
#elif (NGX_HAVE_GCC_VARIADIC_MACROS)
|
||||||
|
|
||||||
|
#define NGX_HAVE_VARIADIC_MACROS 1
|
||||||
|
|
||||||
|
#define ngx_log_error(level, log, args...) \
|
||||||
|
if ((log)->log_level >= level) ngx_log_error_core(level, log, args)
|
||||||
|
|
||||||
|
void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
|
||||||
|
const char *fmt, ...);
|
||||||
|
|
||||||
|
#define ngx_log_debug(level, log, args...) \
|
||||||
|
if ((log)->log_level & level) \
|
||||||
|
ngx_log_error_core(NGX_LOG_DEBUG, log, args)
|
||||||
|
|
||||||
|
/*********************************/
|
||||||
|
|
||||||
#else /* NO VARIADIC MACROS */
|
#else /* NO VARIADIC MACROS */
|
||||||
|
|
||||||
#define NGX_HAVE_VARIADIC_MACROS 0
|
#define NGX_HAVE_VARIADIC_MACROS 0
|
||||||
|
Loading…
Reference in New Issue
Block a user