]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/OnigurumaUefiPort.h
MdeModulePkg: Delete useless case code
[mirror_edk2.git] / MdeModulePkg / Universal / RegularExpressionDxe / Oniguruma / OnigurumaUefiPort.h
index 504c9fb4f7a0f29f6d6b0cc85475d2950751ab01..d24ac1d880b04c19462bce20e41edd4d71993c58 100644 (file)
@@ -2,7 +2,7 @@
   \r
   Module to rewrite stdlib references within Oniguruma\r
 \r
-  Copyright (c) 2014-2015, Hewlett-Packard Development Company, L.P.<BR>\r
+  (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP<BR>\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License that accompanies this\r
@@ -30,7 +30,17 @@ typedef UINTN size_t;
 \r
 #define malloc(n) AllocatePool(n)\r
 #define calloc(n,s) AllocateZeroPool((n)*(s))\r
-#define free(p) FreePool(p)\r
+\r
+#define free(p)             \\r
+  do {                      \\r
+    VOID *EvalOnce;         \\r
+                            \\r
+    EvalOnce = (p);         \\r
+    if (EvalOnce != NULL) { \\r
+      FreePool (EvalOnce);  \\r
+    }                       \\r
+  } while (FALSE)\r
+\r
 #define realloc(OldPtr,NewSize,OldSize) ReallocatePool(OldSize,NewSize,OldPtr)\r
 #define xmemmove(Dest,Src,Length) CopyMem(Dest,Src,Length)\r
 #define xmemcpy(Dest,Src,Length) CopyMem(Dest,Src,Length)\r
@@ -51,7 +61,7 @@ typedef UINTN size_t;
 #define setlocale(a,b)\r
 #define LC_ALL 0\r
 \r
-//#define MAX_STRING_SIZE 0x1000\r
+#define MAX_STRING_SIZE 0x1000\r
 #define strlen_s(String,MaxSize)            AsciiStrnLenS (String, MaxSize)\r
 #define strcat_s(Dest,MaxSize,Src)          AsciiStrCatS (Dest, MaxSize, Src)\r
 #define strncpy_s(Dest,MaxSize,Src,Length)  AsciiStrnCpyS (Dest, MaxSize, Src, Length)\r
@@ -59,7 +69,7 @@ typedef UINTN size_t;
 \r
 int OnigStrCmp (char* Str1, char* Str2);\r
 \r
-int sprintf (char *str, char const *fmt, ...);\r
+int EFIAPI sprintf_s (char *str, size_t sizeOfBuffer, char const *fmt, ...);\r
 \r
 #define exit(n) ASSERT(FALSE);\r
 \r