mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-07 16:01:30 +00:00
Fix FreeBSD build
This commit is contained in:
1 parent
f7fbcd2451
commit
32f3c48b65
4 files changed
+18
-7
No files matched your search
@@ -18,12 +18,12 @@ CFLAGS ?= $(OPTS) $(WARN) $(INCS) $(DEFS) $(ASAN) -DMG_ENABLE_IPV6=$(IPV6) $(TFL
|
|||||||
.PHONY: examples test
|
.PHONY: examples test
|
||||||
|
|
||||||
ifeq "$(SSL)" "MBEDTLS"
|
ifeq "$(SSL)" "MBEDTLS"
|
||||||
MBEDTLS ?= /usr
|
MBEDTLS ?= /usr/local
|
||||||
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
|
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
|
||||||
LDFLAGS ?= -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
|
LDFLAGS ?= -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
|
||||||
endif
|
endif
|
||||||
ifeq "$(SSL)" "OPENSSL"
|
ifeq "$(SSL)" "OPENSSL"
|
||||||
OPENSSL ?= /usr
|
OPENSSL ?= /usr/local
|
||||||
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include
|
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include
|
||||||
LDFLAGS ?= -L$(OPENSSL)/lib -lssl -lcrypto
|
LDFLAGS ?= -L$(OPENSSL)/lib -lssl -lcrypto
|
||||||
endif
|
endif
|
||||||
|
|||||||
+13
-4
@@ -312,6 +312,7 @@ struct timeval {
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@@ -590,17 +591,24 @@ bool mg_log_prefix(int ll, const char *file, int line, const char *fname);
|
|||||||
void mg_log_set(const char *spec);
|
void mg_log_set(const char *spec);
|
||||||
void mg_log_set_callback(void (*fn)(const void *, size_t, void *), void *param);
|
void mg_log_set_callback(void (*fn)(const void *, size_t, void *), void *param);
|
||||||
|
|
||||||
|
// Let the compiler always see the log invocation in order to check parameters
|
||||||
|
// For MG_ENABLE_LOG=0 case, the call will be optimised out, anyway
|
||||||
|
|
||||||
#if MG_ENABLE_LOG
|
#if MG_ENABLE_LOG
|
||||||
|
|
||||||
#define LOG(level, args) \
|
#define LOG(level, args) \
|
||||||
do { \
|
do { \
|
||||||
if (mg_log_prefix((level), __FILE__, __LINE__, __func__)) mg_log args; \
|
if (mg_log_prefix((level), __FILE__, __LINE__, __func__)) mg_log args; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define LOG(level, args) \
|
#define LOG(level, args) \
|
||||||
do { \
|
do { \
|
||||||
(void) level; \
|
(void) level; \
|
||||||
if (0) mg_log args; \
|
if (0) mg_log args; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -983,11 +991,12 @@ long mg_tls_recv(struct mg_connection *, void *buf, size_t len);
|
|||||||
void mg_tls_handshake(struct mg_connection *);
|
void mg_tls_handshake(struct mg_connection *);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if MG_ENABLE_MBEDTLS
|
#if MG_ENABLE_MBEDTLS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <mbedtls/debug.h>
|
#include <mbedtls/debug.h>
|
||||||
#include <mbedtls/net_sockets.h>
|
#include <mbedtls/net_sockets.h>
|
||||||
#include <mbedtls/ssl.h>
|
#include <mbedtls/ssl.h>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|||||||
+2
-1
@@ -1,10 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if MG_ENABLE_MBEDTLS
|
#include "config.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
#if MG_ENABLE_MBEDTLS
|
||||||
#include <mbedtls/debug.h>
|
#include <mbedtls/debug.h>
|
||||||
#include <mbedtls/net_sockets.h>
|
#include <mbedtls/net_sockets.h>
|
||||||
#include <mbedtls/ssl.h>
|
#include <mbedtls/ssl.h>
|
||||||
|
|||||||
Reference in new issue
Block a user