summaryrefslogtreecommitdiff
path: root/src/regposerr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regposerr.c')
-rw-r--r--src/regposerr.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/regposerr.c b/src/regposerr.c
index e1747c5..12d95a9 100644
--- a/src/regposerr.c
+++ b/src/regposerr.c
@@ -2,7 +2,7 @@
regposerr.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2019 K.Kosako
+ * Copyright (c) 2002-2020 K.Kosako
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,7 +37,10 @@
#include "config.h"
#include "onigposix.h"
+#ifndef ONIG_NO_STANDARD_C_HEADERS
#include <string.h>
+#include <stdio.h>
+#endif
#if defined(__GNUC__)
# define ARG_UNUSED __attribute__ ((unused))
@@ -46,13 +49,26 @@
#endif
#if defined(_WIN32) && !defined(__GNUC__)
+
+#ifndef xsnprintf
#define xsnprintf sprintf_s
+#endif
+#ifndef xstrncpy
#define xstrncpy(dest,src,size) strncpy_s(dest,size,src,_TRUNCATE)
+#endif
+
#else
+
+#ifndef xsnprintf
#define xsnprintf snprintf
+#endif
+#ifndef xstrncpy
#define xstrncpy strncpy
#endif
+#endif
+
+
static char* ESTRING[] = {
NULL,
"failed to match", /* REG_NOMATCH */
@@ -75,7 +91,6 @@ static char* ESTRING[] = {
"invalid argument" /* REG_EONIG_BADARG */
};
-#include <stdio.h>
extern size_t