(Win32) Add 'major' and 'minor' arguments to 'get_os' function

pointer
This commit is contained in:
twinaphex 2015-04-07 23:28:45 +02:00
parent a707c24232
commit 1c2a96ac0b
2 changed files with 28 additions and 13 deletions

View File

@ -19,18 +19,33 @@
#include <stddef.h>
#include <string.h>
#include "../general.h"
static void frontend_win32_get_os(char *name, size_t sizeof_name, int *major, int *minor)
{
DWORD version = GetVersion();
*major = (DWORD)(LOBYTE(LOWORD(version)));
*minor = (DWORD)(HIBYTE(LOWORD(version)));
}
static void frontend_win32_environment_get(int *argc, char *argv[],
void *args, void *params_data)
{
}
const frontend_ctx_driver_t frontend_ctx_win32 = {
NULL, /* environment_get */
NULL, /* init */
NULL, /* deinit */
NULL, /* exitspawn */
NULL, /* process_args */
NULL, /* exec */
NULL, /* set_fork */
NULL, /* shutdown */
NULL, /* get_name */
NULL, /* get_os */
NULL, /* get_rating */
NULL, /* load_content */
frontend_win32_environment_get, /* environment_get */
NULL, /* init */
NULL, /* deinit */
NULL, /* exitspawn */
NULL, /* process_args */
NULL, /* exec */
NULL, /* set_fork */
NULL, /* shutdown */
NULL, /* get_name */
frontend_win32_get_os, /* get_os */
NULL, /* get_rating */
NULL, /* load_content */
"win32",
};

View File

@ -44,7 +44,7 @@ typedef struct frontend_ctx_driver
void (*set_fork)(bool exitspawn, bool start_game);
void (*shutdown)(bool);
void (*get_name)(char *, size_t);
void (*get_os)(char *, size_t);
void (*get_os)(char *, size_t, int *major, int *minor);
int (*get_rating)(void);
void (*content_loaded)(void);