2020-12-05 11:26:32 +00: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 09:12:06 +01:00
|
|
|
#define MG_ARCH_FREERTOS_TCP 5
|
2021-05-28 23:49:26 +01:00
|
|
|
#define MG_ARCH_FREERTOS_LWIP 6
|
2021-09-14 09:28:28 +03:00
|
|
|
#define MG_ARCH_AZURERTOS 7
|
2022-02-18 10:07:10 +02:00
|
|
|
#define MG_ARCH_RTX_LWIP 8
|
2022-03-30 07:56:44 +01:00
|
|
|
#define MG_ARCH_ZEPHYR 9
|
2022-05-01 13:47:33 +01:00
|
|
|
#define MG_ARCH_NEWLIB 10
|
2022-05-12 08:07:51 +01:00
|
|
|
#define MG_ARCH_RTX 11
|
2022-05-15 19:18:18 +03:00
|
|
|
#define MG_ARCH_TIRTOS 12
|
2022-07-03 23:00:15 +01:00
|
|
|
#define MG_ARCH_RP2040 13
|
2020-12-05 11:26:32 +00:00
|
|
|
|
|
|
|
#if !defined(MG_ARCH)
|
2021-05-11 09:12:06 +01:00
|
|
|
#if defined(__unix__) || defined(__APPLE__)
|
2020-12-05 11:26:32 +00: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
|
2022-10-21 11:39:45 -03:00
|
|
|
#elif defined(__ZEPHYR__)
|
|
|
|
#define MG_ARCH MG_ARCH_ZEPHYR
|
2020-12-27 01:29:42 +00:00
|
|
|
#elif defined(ESP_PLATFORM)
|
|
|
|
#define MG_ARCH MG_ARCH_ESP32
|
2021-05-17 17:36:57 +01:00
|
|
|
#elif defined(FREERTOS_IP_H)
|
|
|
|
#define MG_ARCH MG_ARCH_FREERTOS_TCP
|
2021-09-14 09:28:28 +03:00
|
|
|
#elif defined(AZURE_RTOS_THREADX)
|
|
|
|
#define MG_ARCH MG_ARCH_AZURERTOS
|
2022-07-03 23:00:15 +01:00
|
|
|
#elif defined(PICO_TARGET_NAME)
|
|
|
|
#define MG_ARCH MG_ARCH_RP2040
|
2020-12-05 11:26:32 +00:00
|
|
|
#endif
|
|
|
|
|
2022-11-01 21:01:33 -03:00
|
|
|
#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM)
|
2022-08-31 18:20:34 +01:00
|
|
|
#include "mongoose_custom.h" // keep this include
|
2020-12-05 11:26:32 +00:00
|
|
|
#endif
|
|
|
|
|
2022-08-20 18:26:29 +01:00
|
|
|
#if !defined(MG_ARCH)
|
|
|
|
#error "MG_ARCH is not specified and we couldn't guess it. Set -D MG_ARCH=..."
|
2020-12-05 11:26:32 +00:00
|
|
|
#endif
|
2022-08-20 18:26:29 +01:00
|
|
|
#endif // !defined(MG_ARCH)
|
2020-12-05 11:26:32 +00:00
|
|
|
|
2022-09-28 12:42:20 +01:00
|
|
|
// http://esr.ibiblio.org/?p=5095
|
|
|
|
#define MG_BIG_ENDIAN (*(uint16_t *)"\0\xff" < 0x100)
|
|
|
|
|
2020-12-05 11:26:32 +00:00
|
|
|
#include "arch_esp32.h"
|
|
|
|
#include "arch_esp8266.h"
|
2021-05-28 23:49:26 +01:00
|
|
|
#include "arch_freertos_lwip.h"
|
2021-05-12 09:25:21 +01:00
|
|
|
#include "arch_freertos_tcp.h"
|
2022-05-01 13:47:33 +01:00
|
|
|
#include "arch_newlib.h"
|
2022-05-12 08:07:51 +01:00
|
|
|
#include "arch_rtx.h"
|
|
|
|
#include "arch_rtx_lwip.h"
|
2020-12-05 11:26:32 +00:00
|
|
|
#include "arch_unix.h"
|
|
|
|
#include "arch_win32.h"
|
2022-03-30 07:56:44 +01:00
|
|
|
#include "arch_zephyr.h"
|