 +		ERROR_EXIT("  Defaulting to least viable amount\n");
 +		phys_mem = SQUASHFS_LOWMEM;
 +	}
-+	#undef SYSCTL_PHYSMEM
++  #undef SYSCTL_PHYSMEM
 +#else
- 	/*
- 	 * Long longs are used here because with PAE, a 32-bit
- 	 * machine can have more than 4GB of physical memory
-@@ -5193,7 +5228,6 @@ int get_physical_memory()
- 	 */
- 	long long num_pages = sysconf(_SC_PHYS_PAGES);
- 	long long page_size = sysconf(_SC_PAGESIZE);
--	int phys_mem;
- 
  	if(num_pages == -1 || page_size == -1) {
  		struct sysinfo sys;
-@@ -5207,6 +5241,7 @@ int get_physical_memory()
+ 		int res = sysinfo(&sys);
+@@ -5207,6 +5245,7 @@ int get_physical_memory()
  	}
  
  	phys_mem = num_pages * page_size >> 20;

 #include <errno.h>
 
+#ifndef FNM_EXTMATCH /* glibc extension */
+ #define FNM_EXTMATCH 0
+#endif
+
 #include "squashfs_fs.h"

 #include <sys/time.h>
 
+#ifndef FNM_EXTMATCH /* glibc extension */
+	#define FNM_EXTMATCH 0
+#endif
+
 #ifndef linux
