mirror of
https://github.com/EnderIce2/rpc-bridge.git
synced 2025-05-25 14:04:37 +00:00
Print version on program start
This commit is contained in:
parent
7363ee64d5
commit
ccf09806c9
5
.vscode/c_cpp_properties.json
vendored
5
.vscode/c_cpp_properties.json
vendored
@ -5,7 +5,10 @@
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"defines": [],
|
||||
"defines": [
|
||||
"GIT_COMMIT",
|
||||
"GIT_BRANCH"
|
||||
],
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "gnu++17",
|
||||
"intelliSenseMode": "windows-gcc-x64"
|
||||
|
5
Makefile
5
Makefile
@ -1,7 +1,10 @@
|
||||
C_SOURCES = $(shell find ./ -type f -name '*.c')
|
||||
C_OBJECTS = $(C_SOURCES:.c=.o)
|
||||
|
||||
CFLAGS = -std=c17 -Wno-int-conversion
|
||||
GIT_COMMIT = $(shell git rev-parse --short HEAD)
|
||||
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
CFLAGS = -std=c17 -Wno-int-conversion -DGIT_COMMIT='"$(GIT_COMMIT)"' -DGIT_BRANCH='"$(GIT_BRANCH)"'
|
||||
LFLAGS = -lgdi32
|
||||
|
||||
# DBGFLAGS = -Wl,--export-all-symbols -g -O0 -ggdb3 -Wall
|
||||
|
7
gui.c
7
gui.c
@ -191,11 +191,14 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_HELP_ABOUT:
|
||||
{
|
||||
char msg[256];
|
||||
sprintf(msg, "rpc-bridge v%s\n\n"
|
||||
snprintf(msg, sizeof(msg),
|
||||
"rpc-bridge v%s\n"
|
||||
" branch: %s\n"
|
||||
" commit: %s\n\n"
|
||||
"Simple bridge that allows you to use Discord Rich Presence with Wine games/software.\n\n"
|
||||
"Created by EnderIce2\n\n"
|
||||
"Licensed under the MIT License",
|
||||
VER_VERSION_STR);
|
||||
VER_VERSION_STR, GIT_BRANCH, GIT_COMMIT);
|
||||
MessageBox(NULL, msg, "About", MB_OK);
|
||||
break;
|
||||
}
|
||||
|
9
main.c
9
main.c
@ -273,12 +273,12 @@ void HandleArguments(int argc, char *argv[])
|
||||
}
|
||||
else if (strcmp(argv[1], "--version") == 0)
|
||||
{
|
||||
printf("%s\n", VER_VERSION_STR);
|
||||
/* Already shows the version */
|
||||
ExitProcess(0);
|
||||
}
|
||||
else if (strcmp(argv[1], "--help") == 0)
|
||||
{
|
||||
printf("Usage:\n"
|
||||
print("Usage:\n"
|
||||
" %s [args]\n"
|
||||
"\n"
|
||||
"Arguments:\n"
|
||||
@ -316,11 +316,12 @@ int main(int argc, char *argv[])
|
||||
g_logFile = fopen(logFilePath, "w");
|
||||
if (g_logFile == NULL)
|
||||
{
|
||||
printf("Failed to open logs file: %ld\n",
|
||||
GetLastError());
|
||||
MessageBox(NULL, "Failed to open logs file", "Error", MB_OK | MB_ICONERROR);
|
||||
printf("Failed to open logs file: %ld\n", GetLastError());
|
||||
ExitProcess(1);
|
||||
}
|
||||
|
||||
print("rpc-bridge v%s %s-%s\n", VER_VERSION_STR, GIT_BRANCH, GIT_COMMIT);
|
||||
if (argc > 1)
|
||||
HandleArguments(argc, argv);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user