*/
/*
* 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.
*/
#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>