Browse Source

Fix small building issue on linux/unix system when building with mmap.

Godzil 1 year ago
parent
commit
bbef89bcd9
2 changed files with 9 additions and 1 deletions
  1. 1 0
      includes/miniffs.h
  2. 8 1
      test/get_fs.h

+ 1 - 0
includes/miniffs.h

@@ -9,6 +9,7 @@
 #ifndef MINIFFS_H
 #define MINIFFS_H
 
+#include <stdio.h>
 #include <stdint.h>
 #include <stdbool.h>
 

+ 8 - 1
test/get_fs.h

@@ -9,6 +9,13 @@
  *
  ******************************************************************************/
 
+#ifndef _WIN32
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+#endif
+
 static miniffs_t *get_fs(const char *filename)
 {
 #ifdef BUILD_PLATFORM_MEMORY
@@ -34,7 +41,7 @@ static miniffs_t *get_fs(const char *filename)
     fstat(fd, &FileStat);
     fs_image = (char *)mmap(NULL, FileStat.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
     close(fd);
-    fileSize = FileStat.st_size
+    fileSize = FileStat.st_size;
     if (fs_image == MAP_FAILED)
     {
         fs_image = NULL;