~drsudo


#60 gmnisrv: Compilations on freebsd 6 months ago

Ticket created by ~drsudo on ~sircmpwn/gmni

I had to add and remove some #includes in order to build this on FreeBSD 12. I successfully compiled with this patch:

diff --git a/include/config.h b/include/config.h
index fc7e9fb..fffd3c5 100644
--- a/include/config.h
+++ b/include/config.h
@@ -5,6 +5,9 @@
 #include <stdbool.h>
 #include "regexp.h"
 
+#include <netinet/in.h>
+#include <sys/socket.h>
+
 struct gmnisrv_tls {
        char *store;
        char *organization;

diff --git a/src/log.c b/src/log.c
index 4d125b3..2f689b2 100644
--- a/src/log.c
+++ b/src/log.c
@@ -4,6 +4,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <sys/socket.h>
+#include "config.h"
 #include "log.h"
 
 static void
diff --git a/src/regexp.c b/src/regexp.c
index 597a908..6e289ac 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -23,7 +23,7 @@
  * THE SOFTWARE.
  */
 #include <assert.h>
-#include <alloca.h>
+//#include <alloca.h>
 #include <inttypes.h>
 #include <stdarg.h>
 #include <stdbool.h>

There would probably need to be #ifdef guard around removing alloca.h.