Skip to content

Commit

Permalink
tuklib_physmem: Comment out support for Windows versions older than 2…
Browse files Browse the repository at this point in the history
…000.
  • Loading branch information
Larhzu committed Sep 24, 2023
1 parent 7d73d1f commit e582f8e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/common/tuklib_physmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,20 @@
#endif


// With GCC >= 8.1 with -Wextra and Clang >= 13 with -Wcast-function-type
// will warn about the Windows-specific code.
#if defined(__has_warning)
# if __has_warning("-Wcast-function-type")
# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
# endif
#elif TUKLIB_GNUC_REQ(8,1)
# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
#endif


extern uint64_t
tuklib_physmem(void)
{
uint64_t ret = 0;

#if defined(_WIN32) || defined(__CYGWIN__)
// This requires Windows 2000 or later.
MEMORYSTATUSEX meminfo;
meminfo.dwLength = sizeof(meminfo);
if (GlobalMemoryStatusEx(&meminfo))
ret = meminfo.ullTotalPhys;

/*
// Old version that is compatible with even Win95:
if ((GetVersion() & 0xFF) >= 5) {
// Windows 2000 and later have GlobalMemoryStatusEx() which
// supports reporting values greater than 4 GiB. To keep the
Expand Down Expand Up @@ -125,6 +122,7 @@ tuklib_physmem(void)
GlobalMemoryStatus(&meminfo);
ret = meminfo.dwTotalPhys;
}
*/

#elif defined(__OS2__)
unsigned long mem;
Expand Down

0 comments on commit e582f8e

Please sign in to comment.