From 6a27efc885b5975c1688573db640c672ab803116 Mon Sep 17 00:00:00 2001 From: Fabio Fiorina Date: Wed, 9 Oct 2002 20:19:23 +0000 Subject: [PATCH] C99 macro --- configure.in | 19 ++++++++++++++++++- lib/ASN1.c | 4 ++-- lib/ASN1.y | 4 ++-- lib/element.c | 6 +++--- lib/errors.c | 14 +++++++++++++- lib/errors.h | 13 +++++++++++-- lib/int.h | 3 +-- 7 files changed, 50 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index 518edda..6ba2bc2 100644 --- a/configure.in +++ b/configure.in @@ -62,13 +62,30 @@ AC_C_CONST AC_C_INLINE +AC_MSG_CHECKING([whether C99 macros are supported]) +AC_TRY_COMPILE(,[ +#define test_mac(...) +int z,y,x; +test_mac(x,y,z); +return 0; +], +dnl ***** OK +AC_DEFINE(C99_MACROS, 1, [C99 macros are supported]) +AC_MSG_RESULT(yes), +dnl ***** NOT FOUND +AC_MSG_RESULT(no) +AC_MSG_WARN([C99 macros are not supported by your compiler. This may +affect compiling.]) +) + + if test $ac_cv_c_compiler_gnu != no; then CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wstrict-prototypes" AC_MSG_CHECKING([whether we have GNU assembler]) - GAS=`as --version < /dev/null 2>/dev/null | grep GNU` + GAS=`as --version < /dev/null|grep GNU` if test "$GAS"; then CFLAGS="${CFLAGS} -pipe" AC_MSG_RESULT(yes) diff --git a/lib/ASN1.c b/lib/ASN1.c index c706e3a..7094ade 100644 --- a/lib/ASN1.c +++ b/lib/ASN1.c @@ -2140,8 +2140,8 @@ int _asn1_yyerror (char *s) { /* Sends the error description to the std_out */ -#ifdef DEBUG_PARSER - _libasn1_log("_asn1_yyerror:%s:%d: %s (Last Token:'%s')\n",fileName, +#ifdef LIBTASN1_DEBUG_PARSER + _libtasn1_log("_asn1_yyerror:%s:%d: %s (Last Token:'%s')\n",fileName, lineNumber,s,lastToken); #endif diff --git a/lib/ASN1.y b/lib/ASN1.y index 45dcb73..e26f3e7 100644 --- a/lib/ASN1.y +++ b/lib/ASN1.y @@ -754,8 +754,8 @@ int _asn1_yyerror (char *s) { /* Sends the error description to the std_out */ -#ifdef DEBUG_PARSER - _libasn1_log("_asn1_yyerror:%s:%d: %s (Last Token:'%s')\n",fileName, +#ifdef LIBTASN1_DEBUG_PARSER + _libtasn1_log("_asn1_yyerror:%s:%d: %s (Last Token:'%s')\n",fileName, lineNumber,s,lastToken); #endif diff --git a/lib/element.c b/lib/element.c index d8c4315..fcedf18 100644 --- a/lib/element.c +++ b/lib/element.c @@ -111,10 +111,10 @@ _asn1_convert_integer(const char *value,unsigned char *value_out,int value_out_s #ifdef LIBTASN1_DEBUG_INTEGER - _libasn1_log("_asn1_convert_integer: valueIn=%s, lenOut=%d",value,*len); + _libtasn1_log("_asn1_convert_integer: valueIn=%s, lenOut=%d",value,*len); for(k=0;k - -#define LIBTASN1_DEBUG /* +#define LIBTASN1_DEBUG #define LIBTASN1_DEBUG_PARSER #define LIBTASN1_DEBUG_INTEGER */ -- 2.11.4.GIT