2020-12-05 19:26:32 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define MG_ARCH_CUSTOM 0
|
|
|
|
#define MG_ARCH_UNIX 1
|
|
|
|
#define MG_ARCH_WIN32 2
|
|
|
|
#define MG_ARCH_ESP32 3
|
|
|
|
#define MG_ARCH_ESP8266 4
|
2021-05-11 16:12:06 +08:00
|
|
|
#define MG_ARCH_FREERTOS_TCP 5
|
2020-12-05 19:26:32 +08:00
|
|
|
|
|
|
|
#if !defined(MG_ARCH)
|
2021-05-11 16:12:06 +08:00
|
|
|
#if defined(__unix__) || defined(__APPLE__)
|
2020-12-05 19:26:32 +08:00
|
|
|
#define MG_ARCH MG_ARCH_UNIX
|
|
|
|
#elif defined(_WIN32)
|
|
|
|
#define MG_ARCH MG_ARCH_WIN32
|
|
|
|
#elif defined(ICACHE_FLASH) || defined(ICACHE_RAM_ATTR)
|
|
|
|
#define MG_ARCH MG_ARCH_ESP8266
|
2020-12-27 09:29:42 +08:00
|
|
|
#elif defined(ESP_PLATFORM)
|
|
|
|
#define MG_ARCH MG_ARCH_ESP32
|
2021-05-18 00:36:57 +08:00
|
|
|
#elif defined(FREERTOS_IP_H)
|
|
|
|
#define MG_ARCH MG_ARCH_FREERTOS_TCP
|
2020-12-05 19:26:32 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(MG_ARCH)
|
|
|
|
#error "MG_ARCH is not specified and we couldn't guess it."
|
|
|
|
#endif
|
|
|
|
#endif // !defined(MG_ARCH)
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
|
|
#define _WINSOCK_DEPRECATED_NO_WARNINGS
|
|
|
|
|
2021-03-13 20:34:26 +08:00
|
|
|
#if !defined(PRINTF_LIKE)
|
|
|
|
#if defined(__GNUC__) || defined(__clang__) || defined(__TI_COMPILER_VERSION__)
|
|
|
|
#define PRINTF_LIKE(f, a) __attribute__((format(printf, f, a)))
|
|
|
|
#else
|
|
|
|
#define PRINTF_LIKE(f, a)
|
|
|
|
#endif
|
|
|
|
#endif
|
2020-12-05 19:26:32 +08:00
|
|
|
|
|
|
|
#if MG_ARCH == MG_ARCH_CUSTOM
|
|
|
|
#include <mongoose_custom.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "arch_esp32.h"
|
|
|
|
#include "arch_esp8266.h"
|
2021-05-12 16:25:21 +08:00
|
|
|
#include "arch_freertos_tcp.h"
|
2020-12-05 19:26:32 +08:00
|
|
|
#include "arch_unix.h"
|
|
|
|
#include "arch_win32.h"
|