summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mauri.cc13
-rw-r--r--src/texture.cc17
2 files changed, 25 insertions, 5 deletions
diff --git a/src/mauri.cc b/src/mauri.cc
index 7cb1476..a1b1b83 100644
--- a/src/mauri.cc
+++ b/src/mauri.cc
@@ -133,6 +133,15 @@ auto window_system_main(u32 argc, str *argv, void *extra) -> s32
}
#ifndef _WIN32
+#include <unistd.h>
+#include <signal.h>
+
+static void sigint_handler(s32 signum)
+{
+ (void)signum;
+ log_info("recieved SIGINT, pid is %d, expecting to be killed by daemon", getpid());
+}
+
auto main(s32 argc, char *argv[]) -> s32
#else
auto wmain(s32 argc, wchar_t **argv) -> s32
@@ -156,6 +165,10 @@ auto wmain(s32 argc, wchar_t **argv) -> s32
args.wparse(argc, argv);
#endif
+#ifndef _WIN32
+ if (args.found("monitor")) signal(SIGINT, sigint_handler);
+#endif
+
if (!stl_global_init(false)) return EXIT_FAILURE;
s32 ret = stl_swallow_main(0, NULL, window_system_main, &args);
diff --git a/src/texture.cc b/src/texture.cc
index 3128a23..a1651f3 100644
--- a/src/texture.cc
+++ b/src/texture.cc
@@ -1,16 +1,23 @@
-_Pragma("GCC diagnostic push")
-_Pragma("GCC diagnostic ignored \"-Wunused-function\"")
-_Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"")
+#include <al/lib.h>
+AL_IGNORE_WARNING("-Wunused-function")
+AL_IGNORE_WARNING("-Wmissing-field-initializers")
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define STB_IMAGE_WRITE_STATIC
+#ifdef MAURI_LOCAL_STB
#include <stb_image_write.h>
-
+#else
+#include <stb/stb_image_write.h>
+#endif
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_STATIC
#define STBI_NO_STDIO
#define STBI_NO_FAILURE_STRINGS
+#ifdef MAURI_LOCAL_STB
#include <stb_image.h>
-_Pragma("GCC diagnostic pop")
+#else
+#include <stb/stb_image.h>
+#endif
+AL_IGNORE_WARNING_END
#include <lz4.h>
#include <s3tc.h>