]> PatchyGit - patchyircd.git/commitdiff
always compile admin.[ch]
authorEgor <egor@patchysicp.xyz>
Wed, 31 Jan 2024 19:08:33 +0000 (21:08 +0200)
committerEgor <egor@patchysicp.xyz>
Wed, 31 Jan 2024 19:08:33 +0000 (21:08 +0200)
this makes it easier to do windows builds

Makefile
src/admin.c
src/admin.h
src/common.h

index f5f2e34..202b53d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
 TARGET := ircd
 SOURCES := \
        src/main.c       \
+       src/admin.c      \
        src/irc.c        \
        src/ircfmt.c     \
        src/net.c        \
@@ -11,6 +12,7 @@ SOURCES := \
 HEADERS := \
        src/common.h     \
        src/config.h     \
+       src/admin.h      \
        src/irc.h        \
        src/ircfmt.h     \
        src/net.h        \
@@ -23,8 +25,6 @@ HEADERS := \
 -include config.mk
 
 ifdef USE_LUA
-SOURCES += src/admin.c
-HEADERS += src/admin.h
 CFLAGS += -DHAS_LUA $(shell pkg-config --cflags lua5.4)
 LDLIBS += $(shell pkg-config --libs lua5.4)
 endif
index 0d8328d..3db32cc 100644 (file)
@@ -1,3 +1,4 @@
+#ifdef HAS_LUA
 #include "admin.h"
 #include "irc.h"
 #include "ircfmt.h"
@@ -485,3 +486,4 @@ int admin_hook(const char *hook, struct client_data *cl1, struct client_data *cl
        lua_pop(L, 1);
        return rv;
 }
+#endif
index 57cd93d..2076d85 100644 (file)
@@ -1,8 +1,10 @@
 #ifndef ADMIN_H_
 #define ADMIN_H_
+#ifdef HAS_LUA
 #include "common.h"
 void admin_init(void);
 void admin_fini(void);
 int admin_command(struct client_data *client, char *source, char *command, int argc, char *args[]);
 int admin_hook(const char *hook, struct client_data *cl1, struct client_data *cl2, struct channel *chan, char *txt);
 #endif
+#endif
index af8b8cd..8251528 100644 (file)
@@ -109,7 +109,5 @@ extern map_t autojoin;
 extern struct client_data  *clients;
 extern struct client_data  *dyingclients;
 
-#ifdef HAS_LUA
 #include "admin.h"
 #endif
-#endif