src/cpuinfo/SDL_cpuinfo.c
changeset 7826 a87057441d01
parent 7823 4ab3a5ee041d
child 7828 1451063c8ecd
--- a/src/cpuinfo/SDL_cpuinfo.c	Thu Oct 17 17:38:55 2013 -0700
+++ b/src/cpuinfo/SDL_cpuinfo.c	Thu Oct 17 20:49:30 2013 -0700
@@ -620,7 +620,16 @@
 #endif
 #ifdef HAVE_SYSCTLBYNAME
         if (SDL_SystemRAM <= 0) {
+#ifdef __FreeBSD__
+#ifdef HW_REALMEM
+            int mib[2] = {CTL_HW, HW_REALMEM};
+#else
+            /* might only report up to 2 GiB */
+            int mib[2] = {CTL_HW, HW_PHYSMEM};
+#endif /* HW_REALMEM */
+#else
             int mib[2] = {CTL_HW, HW_MEMSIZE};
+#endif /* __FreeBSD__ */
             Uint64 memsize = 0;
             size_t len = sizeof(memsize);