aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2020-10-20 23:37:13 +0200
committerJan200101 <sentrycraft123@gmail.com>2020-10-20 23:37:13 +0200
commit7b3ee49b6aa5bcff2b46987ebc8d9cd46b9e5ac1 (patch)
tree7ce2fc46c98cd052893f01feda8b8f212f4c8f70 /src/common.h
parentdb8ae62fb64fa33657f598a62045f17fc779ef8b (diff)
downloadpolecat-7b3ee49b6aa5bcff2b46987ebc8d9cd46b9e5ac1.tar.gz
polecat-7b3ee49b6aa5bcff2b46987ebc8d9cd46b9e5ac1.zip
improve codebase quality
- improve unreachable macro to print a message with a minor traceback then exit(0) instead of assert hackery - add specific wine and dxvk directory methods - rename dxvk install to download - remove sanity asserts from lutris, caught by unreachable - improve comments - rename info to env - only use a single buffer for information fetching - fix formatting on code I had help on - purge unused code - if downloadToRam returns null pointer report that the archive went missing not that its invalid - rename undescriptive "datadir" to be more specific - remove unused code from when we stored the archive on disk
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/common.h b/src/common.h
index 03b103f..1d4c70b 100644
--- a/src/common.h
+++ b/src/common.h
@@ -1,6 +1,7 @@
#ifndef COMMON_H
#define COMMON_H
+#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
@@ -26,9 +27,11 @@
#define USAGE_STR "Usage: " NAME
-// inspired by Zigs unreachable
-#include <assert.h>
-#define unreachable assert(0 && "unreachable code reached")
+#ifdef DEBUG
+#define unreachable printf("unreachable code reached\n" __FILE__ ":L%i\n", __LINE__); exit(0);
+#else
+#define unreachable
+#endif
struct MemoryStruct {
uint8_t* memory;