SDL_time.h: Renaming enums SDL_DATE_FORMAT and SDL_TIME_FORMAT to SDL_DateFormat and SDL_TimeFormat

This commit is contained in:
Petar Popovic
2024-04-08 01:58:26 +02:00
committed by Ryan C. Gordon
parent f08c31060a
commit 764fe72449
10 changed files with 18 additions and 18 deletions

View File

@@ -66,8 +66,8 @@ void SDL_InitTime()
}
/* Default to ISO 8061 date format, as it is unambiguous, and 24 hour time. */
SDL_DATE_FORMAT dateFormat = SDL_DATE_FORMAT_YYYYMMDD;
SDL_TIME_FORMAT timeFormat = SDL_TIME_FORMAT_24HR;
SDL_DateFormat dateFormat = SDL_DATE_FORMAT_YYYYMMDD;
SDL_TimeFormat timeFormat = SDL_TIME_FORMAT_24HR;
SDL_PropertiesID props = SDL_GetGlobalProperties();
SDL_GetSystemTimeLocalePreferences(&dateFormat, &timeFormat);

View File

@@ -34,6 +34,6 @@ extern void SDL_QuitTime(void);
*/
extern Sint64 SDL_CivilToDays(int year, int month, int day, int *day_of_week, int *day_of_year);
extern void SDL_GetSystemTimeLocalePreferences(SDL_DATE_FORMAT *df, SDL_TIME_FORMAT *tf);
extern void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf);
#endif /* SDL_time_c_h_ */

View File

@@ -56,10 +56,10 @@ static void civil_from_days(int days, int *year, int *month, int *day)
*day = (int)d;
}
void SDL_GetSystemTimeLocalePreferences(SDL_DATE_FORMAT *df, SDL_TIME_FORMAT *tf)
void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
{
/* The 3DS only has 12 supported languages, so take the standard for each */
static const SDL_DATE_FORMAT LANG_TO_DATE_FORMAT[] = {
static const SDL_DateFormat LANG_TO_DATE_FORMAT[] = {
SDL_DATE_FORMAT_YYYYMMDD, /* JP */
SDL_DATE_FORMAT_DDMMYYYY, /* EN, assume non-american format */
SDL_DATE_FORMAT_DDMMYYYY, /* FR */

View File

@@ -28,7 +28,7 @@
#define UNIX_EPOCH_OFFSET_SEC 946717200
/* TODO: Implement this... */
void SDL_GetSystemTimeLocalePreferences(SDL_DATE_FORMAT *df, SDL_TIME_FORMAT *tf)
void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
{
}

View File

@@ -30,7 +30,7 @@
/* Sony seems to use 0001-01-01T00:00:00 as an epoch. */
#define DELTA_EPOCH_0001_OFFSET 62135596800ULL
void SDL_GetSystemTimeLocalePreferences(SDL_DATE_FORMAT *df, SDL_TIME_FORMAT *tf)
void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
{
int val;

View File

@@ -34,7 +34,7 @@
#include <mach/mach_time.h>
#endif
void SDL_GetSystemTimeLocalePreferences(SDL_DATE_FORMAT *df, SDL_TIME_FORMAT *tf)
void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
{
/* This *should* be well-supported aside from very old legacy systems, but apparently
* Android didn't add this until SDK version 26, so a check is needed...

View File

@@ -30,7 +30,7 @@
/* Sony seems to use 0001-01-01T00:00:00 as an epoch. */
#define DELTA_EPOCH_0001_OFFSET 62135596800ULL
void SDL_GetSystemTimeLocalePreferences(SDL_DATE_FORMAT *df, SDL_TIME_FORMAT *tf)
void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
{
int val;
SceAppUtilInitParam initParam;

View File

@@ -34,7 +34,7 @@
typedef void(WINAPI *pfnGetSystemTimePreciseAsFileTime)(FILETIME *);
void SDL_GetSystemTimeLocalePreferences(SDL_DATE_FORMAT *df, SDL_TIME_FORMAT *tf)
void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
{
WCHAR str[80]; /* Per the docs, the time and short date format strings can be a max of 80 characters. */