mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-23 18:53:08 +08:00
cpuinfo: Rename SDL_GetCPUCount to SDL_GetNumLogicalCPUCores
This was the only API that broke the "GetNumThings" convention used elsewhere, so renaming it helps with consistency. Adding "logical cores" to the name also makes it a bit more immediately obvious what the count actually represents.
This commit is contained in:
committed by
Sam Lantinga
parent
93bf534268
commit
1f3fd65c4c
@@ -54,7 +54,7 @@ extern "C" {
|
||||
#define SDL_CACHELINE_SIZE 128
|
||||
|
||||
/**
|
||||
* Get the number of CPU cores available.
|
||||
* Get the number of logical CPU cores available.
|
||||
*
|
||||
* \returns the total number of logical CPU cores. On CPUs that include
|
||||
* technologies such as hyperthreading, the number of logical cores
|
||||
@@ -62,7 +62,7 @@ extern "C" {
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetCPUCount(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumLogicalCPUCores(void);
|
||||
|
||||
/**
|
||||
* Determine the L1 cache line size of the CPU.
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#define SDL_NewAudioStream SDL_CreateAudioStream
|
||||
|
||||
/* ##SDL_cpuinfo.h */
|
||||
#define SDL_GetCPUCount SDL_GetNumLogicalCPUCores
|
||||
#define SDL_SIMDGetAlignment SDL_GetSIMDAlignment
|
||||
|
||||
/* ##SDL_endian.h */
|
||||
@@ -703,6 +704,7 @@
|
||||
#define SDL_NewAudioStream SDL_NewAudioStream_renamed_SDL_CreateAudioStream
|
||||
|
||||
/* ##SDL_cpuinfo.h */
|
||||
#define SDL_GetCPUCount SDL_GetCPUCount_renamed_SDL_GetNumLogicalCPUCores
|
||||
#define SDL_SIMDGetAlignment SDL_SIMDGetAlignment_renamed_SDL_GetSIMDAlignment
|
||||
|
||||
/* ##SDL_endian.h */
|
||||
|
||||
Reference in New Issue
Block a user