summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build15
-rw-r--r--minecctl/minecctl.c2
-rw-r--r--minecproxy/main.c2
-rw-r--r--shared/list.h7
4 files changed, 21 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index cd95e87..eb9ae1e 100644
--- a/meson.build
+++ b/meson.build
@@ -2,10 +2,21 @@ project('minecproxy',
'c',
version: '0.1.0',
license: 'GPL2+',
- default_options : ['c_std=gnu18']
+ default_options : [
+ 'c_std=gnu18',
+ 'sysconfdir=/etc',
+ 'warning_level=2',
+ ]
)
-add_global_arguments('-D_GNU_SOURCE', language: 'c')
+cc = meson.get_compiler('c')
+
+basic_disabled_warnings = [
+ '-Wno-sign-compare',
+]
+add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')
+
+add_project_arguments('-D_GNU_SOURCE', language: 'c')
sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'), meson.project_name())
mainconfname = meson.project_name() + '.conf'
diff --git a/minecctl/minecctl.c b/minecctl/minecctl.c
index 6f3133d..e233528 100644
--- a/minecctl/minecctl.c
+++ b/minecctl/minecctl.c
@@ -34,7 +34,7 @@ __die(const char *fmt, ...)
va_end(ap);
exit(EXIT_FAILURE);
-};
+}
void *
__zmalloc(const char *fn, int line, size_t size)
diff --git a/minecproxy/main.c b/minecproxy/main.c
index 8513766..7cd3336 100644
--- a/minecproxy/main.c
+++ b/minecproxy/main.c
@@ -170,7 +170,7 @@ __die(const char *fmt, ...)
sd_notifyf(0, "STATUS=Error, shutting down");
exit(EXIT_FAILURE);
-};
+}
static void
cfg_free(struct uring_task *task)
diff --git a/shared/list.h b/shared/list.h
index df4092a..be59dc9 100644
--- a/shared/list.h
+++ b/shared/list.h
@@ -1,6 +1,11 @@
#ifndef foolisthfoo
#define foolisthfoo
+/*
+ * Doubly linked list implementation from the Linux kernel
+ * Copyright Linus Torvalds et al, GPLv2
+*/
+
struct list_head {
struct list_head *next;
struct list_head *prev;
@@ -46,7 +51,7 @@ static inline bool list_empty(struct list_head *list)
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#define container_of(ptr, type, member) ({ \
+#define container_of(ptr, type, member) __extension__ ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})