Making sure no warnings are printed (except for getenv) on windows.

This commit is contained in:
2026-04-17 13:58:28 +02:00
parent ee33c72915
commit 89b084a6a7
6 changed files with 27 additions and 16 deletions

View File

@@ -31,6 +31,10 @@
#define ALIVE_SLOT 4
#define ALIVE_ACK_SLOT 5
#ifdef _WIN32
#define strdup _strdup
#endif
//#define DEBUG
/////////////////////////////////////////////////////////////////////
@@ -106,12 +110,12 @@ bool runRktWebview(Handle_t *handler)
char alive_slot[10];
char alive_ack_slot[10];
sprintf(shm_size_str, "%d", static_cast<int>(handler->shm_size));
sprintf(command_slot, "%d", COMMAND_SLOT);
sprintf(command_result_slot, "%d", COMMAND_RESULT_SLOT);
sprintf(event_slot, "%d", EVENT_SLOT);
sprintf(alive_slot, "%d", ALIVE_SLOT);
sprintf(alive_ack_slot, "%d", ALIVE_ACK_SLOT);
snprintf(shm_size_str, 30, "%d", static_cast<int>(handler->shm_size));
snprintf(command_slot, 10, "%d", COMMAND_SLOT);
snprintf(command_result_slot, 10, "%d", COMMAND_RESULT_SLOT);
snprintf(event_slot, 10, "%d", EVENT_SLOT);
snprintf(alive_slot, 10, "%d", ALIVE_SLOT);
snprintf(alive_ack_slot, 10, "%d", ALIVE_ACK_SLOT);
// run rktwebview_prg using the environment variable RKT_WEBVIEW_PRG
@@ -316,7 +320,7 @@ void rkt_webview_init()
#else
#ifdef _WIN32
DWORD p = GetCurrentProcessId();
sprintf(buf, "rktwebview-%ld", p);
snprintf(buf, 1024, "rktwebview-%ld", p);
#else
pid_t p = getpid();
sprintf(buf, "rktwebview-%x", p);