check_function_exists(alloca HAVE_ALLOCA)
check_include_files(alloca.h HAVE_ALLOCA_H)
-set(HAVE_PROTOTYPES 1)
-check_include_files(stdarg.h HAVE_STDARG_PROTOTYPES)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(sys/times.h HAVE_SYS_TIMES_H)
dnl Checks for library functions.
AC_FUNC_ALLOCA
-AC_CACHE_CHECK(for prototypes, _cv_have_prototypes,
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[int foo(int x) { return 0; }]],
- [[return foo(10);]])],
- [_cv_have_prototypes=yes],
- [_cv_have_prototypes=no])])
-if test "$_cv_have_prototypes" = yes; then
- AC_DEFINE(HAVE_PROTOTYPES,1,[Define if compilerr supports prototypes])
-fi
-
-AC_CACHE_CHECK(for variable length prototypes and stdarg.h, _cv_stdarg,
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <stdarg.h>
-int foo(int x, ...) {
- va_list va;
- va_start(va, x);
- va_arg(va, int);
- va_arg(va, char *);
- va_arg(va, double);
- return 0;
-}
-]], [[return foo(10, "", 3.14);]])],[_cv_stdarg=yes],[_cv_stdarg=no])])
-if test "$_cv_stdarg" = yes; then
- AC_DEFINE(HAVE_STDARG_PROTOTYPES,1,[Define if compiler supports stdarg prototypes])
-fi
-
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile sample/Makefile onig-config])
AC_CONFIG_COMMANDS([default],[chmod +x onig-config],[])
AC_OUTPUT
*/
#cmakedefine HAVE_ALLOCA_H ${HAVE_ALLOCA_H}
-/* Define if compilerr supports prototypes */
-#cmakedefine HAVE_PROTOTYPES ${HAVE_PROTOTYPES}
-
-/* Define if compiler supports stdarg prototypes */
-#cmakedefine HAVE_STDARG_PROTOTYPES ${HAVE_STDARG_PROTOTYPES}
-
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
#define SIZEOF_VOIDP 4\r
#define SIZEOF_FLOAT 4\r
#define SIZEOF_DOUBLE 8\r
-#define HAVE_PROTOTYPES 1\r
#define TOKEN_PASTE(x,y) x##y\r
-#define HAVE_STDARG_PROTOTYPES 1\r
#ifndef NORETURN\r
#if _MSC_VER > 1100\r
#define NORETURN(x) __declspec(noreturn) x\r
#define SIZEOF_VOIDP 8\r
#define SIZEOF_FLOAT 4\r
#define SIZEOF_DOUBLE 8\r
-#define HAVE_PROTOTYPES 1\r
#define TOKEN_PASTE(x,y) x##y\r
-#define HAVE_STDARG_PROTOTYPES 1\r
#ifndef NORETURN\r
#if _MSC_VER > 1100\r
#define NORETURN(x) __declspec(noreturn) x\r
#endif\r
#define SIZEOF_FLOAT 4\r
#define SIZEOF_DOUBLE 8\r
-#define HAVE_PROTOTYPES 1\r
#define TOKEN_PASTE(x,y) x##y\r
-#define HAVE_STDARG_PROTOTYPES 1\r
#ifndef NORETURN\r
#if _MSC_VER > 1100\r
#define NORETURN(x) __declspec(noreturn) x\r
#include "regint.h"
#include <stdio.h> /* for vsnprintf() */
-#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
-#define va_init_list(a,b) va_start(a,b)
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start(a)
-#endif
extern UChar*
onig_error_code_to_format(int code)
/* for ONIG_MAX_ERROR_MESSAGE_LEN */
#define MAX_ERROR_PAR_LEN 30
-extern int
-#ifdef HAVE_STDARG_PROTOTYPES
-onig_error_code_to_str(UChar* s, int code, ...)
-#else
-onig_error_code_to_str(s, code, va_alist)
- UChar* s;
- int code;
- va_dcl
-#endif
+extern int onig_error_code_to_str(UChar* s, int code, ...)
{
UChar *p, *q;
OnigErrorInfo* einfo;
UChar parbuf[MAX_ERROR_PAR_LEN];
va_list vargs;
- va_init_list(vargs, code);
+ va_start(vargs, code);
switch (code) {
case ONIGERR_UNDEFINED_NAME_REFERENCE:
}
-void
-#ifdef HAVE_STDARG_PROTOTYPES
-onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
- UChar* pat, UChar* pat_end, const UChar *fmt, ...)
-#else
-onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
- UChar buf[];
- int bufsize;
- OnigEncoding enc;
- UChar* pat;
- UChar* pat_end;
- const UChar *fmt;
- va_dcl
-#endif
+void onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
+ UChar* pat, UChar* pat_end, const UChar *fmt, ...)
{
int n, need, len;
UChar *p, *s, *bp;
UChar bs[6];
va_list args;
- va_init_list(args, fmt);
+ va_start(args, fmt);
n = xvsnprintf((char* )buf, bufsize, (const char* )fmt, args);
va_end(args);
#include "regenc.h"
-#ifdef __cplusplus
-# ifndef HAVE_STDARG_PROTOTYPES
-# define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-
-/* escape Mac OS X/Xcode 2.4/gcc 4.0.1 problem */
-#if defined(__APPLE__) && defined(__GNUC__) && __GNUC__ >= 4
-# ifndef HAVE_STDARG_PROTOTYPES
-# define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-
-#ifdef HAVE_STDARG_H
-# ifndef HAVE_STDARG_PROTOTYPES
-# define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-
-
#define INIT_MATCH_STACK_SIZE 160
#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */
#define DEFAULT_RETRY_LIMIT_IN_MATCH 10000000