]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/regposerr.c
MdeModulePkg RegularExpressionDxe: Update Oniguruma to 6.9.0
[mirror_edk2.git] / MdeModulePkg / Universal / RegularExpressionDxe / Oniguruma / regposerr.c
index fb1b9286a2063528436ea10ec121b99060952f91..a396df2acf1262346f239faf0f1a45741974497e 100644 (file)
@@ -2,11 +2,9 @@
   regposerr.c - Oniguruma (regular expression library)\r
 **********************************************************************/\r
 /*-\r
- * Copyright (c) 2002-2007  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>\r
+ * Copyright (c) 2002-2018  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>\r
  * All rights reserved.\r
  *\r
- * (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
- *\r
  * Redistribution and use in source and binary forms, with or without\r
  * modification, are permitted provided that the following conditions\r
  * are met:\r
  * SUCH DAMAGE.\r
  */\r
 \r
-/*#include "config.h"*/\r
+/* Can't include regint.h etc.. for conflict of regex_t.\r
+   Define ONIGURUMA_EXPORT here for onigposix.h.\r
+ */\r
+#ifndef ONIGURUMA_EXPORT\r
+#define ONIGURUMA_EXPORT\r
+#endif\r
+\r
+//#include "config.h"\r
 #include "onigposix.h"\r
 \r
 #if 0\r
 #  define ARG_UNUSED\r
 #endif\r
 \r
+#if defined(_WIN32) && !defined(__GNUC__)\r
+#define xsnprintf   sprintf_s\r
+#define xstrncpy(dest,src,size)   strncpy_s(dest,size,src,_TRUNCATE)\r
+#else\r
+#define xsnprintf   snprintf\r
+#define xstrncpy    strncpy\r
+#endif\r
+\r
 static char* ESTRING[] = {\r
   NULL,\r
   "failed to match",                         /* REG_NOMATCH    */\r
@@ -65,8 +78,7 @@ static char* ESTRING[] = {
   /* Extended errors */\r
   "internal error",                          /* REG_EONIG_INTERNAL */\r
   "invalid wide char value",                 /* REG_EONIG_BADWC    */\r
-  "invalid argument",                        /* REG_EONIG_BADARG   */\r
-  "multi-thread error"                       /* REG_EONIG_THREAD   */\r
+  "invalid argument"                         /* REG_EONIG_BADARG   */\r
 };\r
 \r
 //#include <stdio.h>\r