mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
SDL_cpuinfo.c: add os/2 support to SDL_GetCPUCount() and SDL_GetSystemRAM().
This commit is contained in:
parent
f807655b7d
commit
b821ded96c
@ -27,6 +27,13 @@
|
|||||||
#if defined(__WIN32__)
|
#if defined(__WIN32__)
|
||||||
#include "../core/windows/SDL_windows.h"
|
#include "../core/windows/SDL_windows.h"
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__OS2__)
|
||||||
|
#define INCL_DOS
|
||||||
|
#include <os2.h>
|
||||||
|
#ifndef QSV_NUMPROCESSORS
|
||||||
|
#define QSV_NUMPROCESSORS 26
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* CPU feature detection for SDL */
|
/* CPU feature detection for SDL */
|
||||||
|
|
||||||
@ -418,6 +425,12 @@ SDL_GetCPUCount(void)
|
|||||||
SDL_CPUCount = info.dwNumberOfProcessors;
|
SDL_CPUCount = info.dwNumberOfProcessors;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __OS2__
|
||||||
|
if (SDL_CPUCount <= 0) {
|
||||||
|
DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS,
|
||||||
|
&SDL_CPUCount, sizeof(SDL_CPUCount) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
/* There has to be at least 1, right? :) */
|
/* There has to be at least 1, right? :) */
|
||||||
if (SDL_CPUCount <= 0) {
|
if (SDL_CPUCount <= 0) {
|
||||||
@ -719,6 +732,13 @@ SDL_GetSystemRAM(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __OS2__
|
||||||
|
if (SDL_SystemRAM <= 0) {
|
||||||
|
Uint32 sysram = 0;
|
||||||
|
DosQuerySysInfo(QSV_TOTPHYSMEM, QSV_TOTPHYSMEM, &sysram, 4);
|
||||||
|
SDL_SystemRAM = (int) (sysram / 0x100000U);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return SDL_SystemRAM;
|
return SDL_SystemRAM;
|
||||||
|
Loading…
Reference in New Issue
Block a user