different debug/release default cfg options
authorJohn Tsiombikas <nuclear@member.fsf.org>
Thu, 30 Dec 2021 13:01:35 +0000 (15:01 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Thu, 30 Dec 2021 13:01:35 +0000 (15:01 +0200)
Makefile
src/cfgopt.c

index bf39c07..0d965ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ bin = demo
 
 warn = -pedantic -Wall
 dbg = -g
-#opt = -O3 -ffast-math -fno-strict-aliasing
+#opt = -O3 -ffast-math -fno-strict-aliasing -DNDEBUG
 def = -DMINIGLUT_USE_LIBC -DGLEW_STATIC
 incdir = -Isrc -Ilibs -Ilibs/imago/src -Ilibs/treestore -Ilibs/glew
 libs_path = libs/unix
index 9f702a9..0672745 100644 (file)
@@ -4,11 +4,23 @@
 #include <ctype.h>
 #include "cfgopt.h"
 
+#ifdef NDEBUG
+/* release default options */
+#define DEFOPT_FULLSCR 1
+#define DEFOPT_VSYNC   1
+#define DEFOPT_MUSIC   1
+#else
+/* debug default options */
+#define DEFOPT_FULLSCR 0
+#define DEFOPT_VSYNC   1
+#define DEFOPT_MUSIC   0
+#endif
+
 struct options opt = {
        0,      /* screen name */
-       0,      /* fullscreen */
-       1,      /* vsync */
-       0,      /* music */
+       DEFOPT_FULLSCR,
+       DEFOPT_VSYNC,
+       DEFOPT_MUSIC
 };
 
 static const char *usagefmt = "Usage: %s [options]\n"