Hai, Konni!
Hab mal wieder gebaut und mit dem aktuellen Kot läuft die Kiste auch auf BSD.
diff --git a/src/dietchan/src/config.h b/src/dietchan/src/config.h
index 9f64c30..4c3af42 100644
--- a/src/dietchan/src/config.h
+++ b/src/dietchan/src/config.h
@@ -75,5 +75,6 @@
#define MAX_GET_PARAM_LENGTH 2048
#define MAX_POST_PARAM_LENGTH 16384
#define MAX_MULTIPART_BOUNDARY_LENGTH 128
+#define NEED_CAPTCHA 0
#endif // CONFIG_H
diff --git a/src/dietchan/src/dietchan.c b/src/dietchan/src/dietchan.c
index 65be601..64ce7ed 100644
--- a/src/dietchan/src/dietchan.c
+++ b/src/dietchan/src/dietchan.c
@@ -380,7 +380,7 @@ int main(int argc, char* argv[])
mkdir(DOC_ROOT "/uploads", 0755);
mkdir(DOC_ROOT "/captchas", 0755);
// Start generating captchas
- generate_captchas();
+ if (NEED_CAPTCHA) generate_captchas();
// Main loop
while (1) {
Eigentlich sollte das nur auskommentiert werden, aber wir haben ja schon eine config.h.
diff --git a/src/dietchan/src/http.c b/src/dietchan/src/http.c
index c141d33..f82f55f 100644
--- a/src/dietchan/src/http.c
+++ b/src/dietchan/src/http.c
@@ -1,6 +1,8 @@
#include "http.h"
+#ifdef __GLIBC__
#include <alloca.h>
+#endif
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
Anscheinend ist alloca.h GLIBC-spezifisch und ich habe überlegt, wie man das umsetzen kann. Wörksformi(tm), aber jetzt fange ich an, den Kot mit ifdefs zu verschandeln. Ich habe mal gelesen, dass das schöner geht, kann mich aber nicht daran erinnern wie.
diff --git a/src/dietchan/src/import.c b/src/dietchan/src/import.c
index eab0a6f..a0ca7a2 100644
--- a/src/dietchan/src/import.c
+++ b/src/dietchan/src/import.c
@@ -1,6 +1,5 @@
#include "import.h"
-#include <malloc.h>
#include <unistd.h>