Skip to content

Commit 9b0d112

Browse files
authored
Merge pull request #2907 from cesanta/armcgt
Add ARMCGT arch
2 parents c4be4e7 + ac17df0 commit 9b0d112

File tree

3 files changed

+64
-24
lines changed

3 files changed

+64
-24
lines changed

mongoose.h

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extern "C" {
4242
#define MG_ARCH_ARMCC 12 // Keil MDK-Core with Configuration Wizard
4343
#define MG_ARCH_CMSIS_RTOS2 13 // CMSIS-RTOS API v2 (Keil RTX5, FreeRTOS)
4444
#define MG_ARCH_RTTHREAD 14 // RT-Thread RTOS
45+
#define MG_ARCH_ARMCGT 15 // Texas Semi ARM-CGT
4546

4647
#if !defined(MG_ARCH)
4748
#if defined(__unix__) || defined(__APPLE__)
@@ -76,6 +77,25 @@ extern "C" {
7677

7778

7879

80+
#if MG_ARCH == MG_ARCH_ARMCGT
81+
82+
#include <ctype.h>
83+
#include <errno.h>
84+
#include <stdarg.h>
85+
#include <stdbool.h>
86+
#include <stdio.h>
87+
#include <stdlib.h>
88+
#include <string.h>
89+
#include <sys/types.h>
90+
#include <time.h>
91+
92+
#define MG_PATH_MAX 100
93+
#define MG_ENABLE_SOCKET 0
94+
#define MG_ENABLE_DIRLIST 0
95+
96+
#endif
97+
98+
7999
#if MG_ARCH == MG_ARCH_AZURERTOS
80100

81101
#include <stdarg.h>
@@ -236,30 +256,30 @@ static inline int mg_mkdir(const char *path, mode_t mode) {
236256
#include <pico/stdlib.h>
237257
int mkdir(const char *, mode_t);
238258
#endif
239-
240-
241-
#if MG_ARCH == MG_ARCH_RTTHREAD
242-
243-
#include <rtthread.h>
244-
#include <ctype.h>
245-
#include <errno.h>
246-
#include <fcntl.h>
247-
#include <sys/socket.h>
248-
#include <sys/select.h>
249-
#include <stdarg.h>
250-
#include <stdbool.h>
251-
#include <stdint.h>
252-
#include <stdio.h>
253-
#include <stdlib.h>
254-
#include <string.h>
255-
#include <sys/types.h>
256-
#include <time.h>
257-
258-
#ifndef MG_IO_SIZE
259-
#define MG_IO_SIZE 1460
260-
#endif
261-
262-
#endif // MG_ARCH == MG_ARCH_RTTHREAD
259+
260+
261+
#if MG_ARCH == MG_ARCH_RTTHREAD
262+
263+
#include <rtthread.h>
264+
#include <ctype.h>
265+
#include <errno.h>
266+
#include <fcntl.h>
267+
#include <sys/socket.h>
268+
#include <sys/select.h>
269+
#include <stdarg.h>
270+
#include <stdbool.h>
271+
#include <stdint.h>
272+
#include <stdio.h>
273+
#include <stdlib.h>
274+
#include <string.h>
275+
#include <sys/types.h>
276+
#include <time.h>
277+
278+
#ifndef MG_IO_SIZE
279+
#define MG_IO_SIZE 1460
280+
#endif
281+
282+
#endif // MG_ARCH == MG_ARCH_RTTHREAD
263283

264284

265285
#if MG_ARCH == MG_ARCH_ARMCC || MG_ARCH == MG_ARCH_CMSIS_RTOS1 || \

src/arch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define MG_ARCH_ARMCC 12 // Keil MDK-Core with Configuration Wizard
1616
#define MG_ARCH_CMSIS_RTOS2 13 // CMSIS-RTOS API v2 (Keil RTX5, FreeRTOS)
1717
#define MG_ARCH_RTTHREAD 14 // RT-Thread RTOS
18+
#define MG_ARCH_ARMCGT 15 // Texas Semi ARM-CGT
1819

1920
#if !defined(MG_ARCH)
2021
#if defined(__unix__) || defined(__APPLE__)

src/arch_armcgt.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#pragma once
2+
3+
#if MG_ARCH == MG_ARCH_ARMCGT
4+
5+
#include <ctype.h>
6+
#include <errno.h>
7+
#include <stdarg.h>
8+
#include <stdbool.h>
9+
#include <stdio.h>
10+
#include <stdlib.h>
11+
#include <string.h>
12+
#include <sys/types.h>
13+
#include <time.h>
14+
15+
#define MG_PATH_MAX 100
16+
#define MG_ENABLE_SOCKET 0
17+
#define MG_ENABLE_DIRLIST 0
18+
19+
#endif

0 commit comments

Comments
 (0)