mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-26 22:41:03 +08:00
Fix FreeBSD build
This commit is contained in:
parent
f7fbcd2451
commit
32f3c48b65
4
Makefile
4
Makefile
@ -18,12 +18,12 @@ CFLAGS ?= $(OPTS) $(WARN) $(INCS) $(DEFS) $(ASAN) -DMG_ENABLE_IPV6=$(IPV6) $(TFL
|
||||
.PHONY: examples test
|
||||
|
||||
ifeq "$(SSL)" "MBEDTLS"
|
||||
MBEDTLS ?= /usr
|
||||
MBEDTLS ?= /usr/local
|
||||
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS)/include -I/usr/include
|
||||
LDFLAGS ?= -L$(MBEDTLS)/lib -lmbedtls -lmbedcrypto -lmbedx509
|
||||
endif
|
||||
ifeq "$(SSL)" "OPENSSL"
|
||||
OPENSSL ?= /usr
|
||||
OPENSSL ?= /usr/local
|
||||
CFLAGS += -DMG_ENABLE_OPENSSL=1 -I$(OPENSSL)/include
|
||||
LDFLAGS ?= -L$(OPENSSL)/lib -lssl -lcrypto
|
||||
endif
|
||||
|
17
mongoose.h
17
mongoose.h
@ -312,6 +312,7 @@ struct timeval {
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <signal.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_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
|
||||
|
||||
#define LOG(level, args) \
|
||||
do { \
|
||||
if (mg_log_prefix((level), __FILE__, __LINE__, __func__)) mg_log args; \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define LOG(level, args) \
|
||||
do { \
|
||||
(void) level; \
|
||||
if (0) mg_log args; \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -983,11 +991,12 @@ long mg_tls_recv(struct mg_connection *, void *buf, size_t len);
|
||||
void mg_tls_handshake(struct mg_connection *);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if MG_ENABLE_MBEDTLS
|
||||
|
||||
|
||||
|
||||
|
||||
#include <mbedtls/debug.h>
|
||||
#include <mbedtls/net_sockets.h>
|
||||
#include <mbedtls/ssl.h>
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <signal.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#if MG_ENABLE_MBEDTLS
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
#include "url.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_MBEDTLS
|
||||
#include <mbedtls/debug.h>
|
||||
#include <mbedtls/net_sockets.h>
|
||||
#include <mbedtls/ssl.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user