mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -04:00
Commit SHA in error log
This commit is contained in:
parent
2984d7ff26
commit
2acb32c1cd
@ -76,6 +76,10 @@ typedef struct Bitmap_ { uint8_t* Scan0; int Width, Height; } Bitmap;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CC_COMMIT_SHA
|
||||
#define CC_COMMIT_SHA "Unknown"
|
||||
#endif
|
||||
|
||||
#ifdef CC_BUILD_D3D9
|
||||
typedef void* GfxResourceID;
|
||||
#define GFX_NULL NULL
|
||||
|
@ -641,6 +641,8 @@ static void ErrorHandler_FailCommon(ReturnCode result, const char* raw_msg, void
|
||||
String msg = String_NT_Array(msgBuffer);
|
||||
|
||||
String_Format3(&msg, "ClassiCube crashed.%cMessage: %c%c", Platform_NewLine, raw_msg, Platform_NewLine);
|
||||
String_Format2(&msg, "Commit SHA: %c%c", CC_COMMIT_SHA, Platform_NewLine);
|
||||
|
||||
if (result) {
|
||||
String_Format2(&msg, "%h%c", &result, Platform_NewLine);
|
||||
} else { result = 1; }
|
||||
|
@ -3,6 +3,7 @@ LIBS=-lGL -lcurl -lopenal -lpthread -lX11 -lm
|
||||
CFLAGS=-g -w -no-pie
|
||||
SOURCES=$(wildcard *.c)
|
||||
OBJECTS=$(patsubst %.c, %.o, $(SOURCES))
|
||||
COMMITSHA=$(shell git rev-parse HEAD | cut -c '1-7')
|
||||
|
||||
EXECUTABLE=ClassiCube
|
||||
|
||||
@ -10,7 +11,7 @@ $(EXECUTABLE): $(OBJECTS)
|
||||
$(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)
|
||||
|
||||
$(OBJECTS): %.o : %.c
|
||||
$(CC) $(CFLAGS) -c $< $(LIBS) -o $@
|
||||
$(CC) $(CFLAGS) -DCC_COMMIT_SHA=\"$(COMMITSHA)\" -c $< $(LIBS) -o $@
|
||||
|
||||
clean:
|
||||
rm -f $(EXECUTABLE) $(OBJECTS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user