]> code.delx.au - refind/blobdiff - libeg/lodepng.h
Version 0.10.4 release.
[refind] / libeg / lodepng.h
index bd3b7149a93038e677e8cef3d8db8e6980a0ed46..1d2cd2534682e9ea18f645ff69ac7866d45004c6 100644 (file)
@@ -24,7 +24,7 @@ freely, subject to the following restrictions:
 */
 /*
  * This version of lodepng.h is modified for use with rEFInd. Some options
- * are commented out and two definitions (commented on shortly) are added
+ * are commented out and several definitions (commented on shortly) are added
  * for GNU-EFI compatibility. The associated lodepng.c file is unmodified
  * from the original.
  */
@@ -34,15 +34,22 @@ freely, subject to the following restrictions:
 
 #include <string.h> /*for size_t*/
 
-// Below two lines required for GNU-EFI (program hangs when run without them,
-// and associated function in lodepng_xtra.c)
+// Below block of lines required for GNU-EFI and TianoCore (program hangs
+// when run without them, and associated function in lodepng_xtra.c)
 int MyStrlen(const char *InString);
 #define strlen(c) MyStrlen(c)
+#include <stdlib.h>
+#define abs(x) (((x) < 0) ? -(x) : (x))
 #ifdef __MAKEWITH_GNUEFI
 #include <efi.h>
 #include <efilib.h>
-#define memcpy(a, b, c) CopyMem(a, b, c)
+#else
+#include "../include/tiano_includes.h"
 #endif
+VOID *MyMemSet(VOID *s, int c, size_t n);
+VOID *MyMemCpy(void *__restrict __dest, const void *__restrict __src, size_t __n);
+#define memset(s, c, n) MyMemSet(s, c, n)
+#define memcpy(d, s, n) MyMemCpy(d, s, n)
 
 #ifdef __cplusplus
 #include <vector>