Skip to content

Commit 8aad691

Browse files
author
Hubert Badocha
committed
types: add #defines to typedefs
Some external program eg mbedtls check for those defines to checks if a type is available. JIRA: RTOS-1027
1 parent 5006455 commit 8aad691

File tree

18 files changed

+79
-0
lines changed

18 files changed

+79
-0
lines changed

include/glob.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ typedef struct {
6767
int (*gl_stat)(const char *, struct stat *);
6868
} glob_t;
6969

70+
#define glob_t glob_t
71+
7072
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
7173
#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
7274
#define GLOB_ERR 0x0004 /* Return on error. */

include/regex.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,24 @@ extern "C" {
4949
/* types */
5050
typedef off_t regoff_t;
5151

52+
#define regoff_t regoff_t
53+
5254
typedef struct {
5355
int re_magic;
5456
size_t re_nsub; /* number of parenthesized subexpressions */
5557
__const char *re_endp; /* end pointer for REG_PEND */
5658
struct re_guts *re_g; /* none of your business :-) */
5759
} regex_t;
5860

61+
#define regex_t regex_t
62+
5963
typedef struct {
6064
regoff_t rm_so; /* start of match */
6165
regoff_t rm_eo; /* end of match */
6266
} regmatch_t;
6367

68+
#define regmatch_t regmatch_t
69+
6470
/* regcomp() flags */
6571
#define REG_BASIC 0000
6672
#define REG_EXTENDED 0001

include/setjmp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ extern "C" {
2727
typedef struct __jmp_buf jmp_buf[1];
2828
typedef jmp_buf sigjmp_buf;
2929

30+
#define jmp_buf jmp_buf
31+
#define sigjmp_buf sigjmp_buf
32+
3033

3134
extern int _setjmp(jmp_buf var);
3235

include/signal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ extern "C" {
2828

2929
typedef void (*sighandler_t)(int);
3030

31+
#define sighandler_t sighandler_t
32+
3133
#define SIGHUP 1
3234
#define SIGINT 2
3335
#define SIGQUIT 3
@@ -84,6 +86,9 @@ enum { SIG_BLOCK, SIG_SETMASK, SIG_UNBLOCK };
8486
typedef int sigset_t;
8587
typedef int sig_atomic_t;
8688

89+
#define sigset_t sigset_t
90+
#define sig_atomic_t sig_atomic_t
91+
8792

8893
union sigval {
8994
int sival_int;

include/stdint.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ typedef __u16 uint16_t;
4242
typedef __u32 uint32_t;
4343
typedef __u64 uint64_t;
4444

45+
#define int8_t int8_t
46+
#define int16_t int16_t
47+
#define int32_t int32_t
48+
#define int64_t int64_t
49+
50+
#define uint8_t uint8_t
51+
#define uint16_t uint16_t
52+
#define uint32_t uint32_t
53+
#define uint64_t uint64_t
54+
4555
/* 7.18.1.2 Minimum-width integer types */
4656

4757
typedef int8_t int_least8_t;
@@ -54,6 +64,16 @@ typedef uint16_t uint_least16_t;
5464
typedef uint32_t uint_least32_t;
5565
typedef uint64_t uint_least64_t;
5666

67+
#define int_least8_t int_least8_t
68+
#define int_least16_t int_least16_t
69+
#define int_least32_t int_least32_t
70+
#define int_least64_t int_least64_t
71+
72+
#define uint_least8_t uint_least8_t
73+
#define uint_least16_t uint_least16_t
74+
#define uint_least32_t uint_least32_t
75+
#define uint_least64_t uint_least64_t
76+
5777
/* 7.18.2.1 Limits of exact-width integer types */
5878

5979
#define INT8_MIN (-127 - 1)

include/stdio.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ extern "C" {
5151

5252
typedef off_t fpos_t;
5353

54+
#define fpos_t fpos_t
55+
5456

5557
typedef struct _FILE {
5658
int fd;
@@ -67,13 +69,17 @@ typedef struct _FILE {
6769
struct _FILE *prev;
6870
} FILE;
6971

72+
#define FILE FILE
73+
7074

7175
typedef struct _DIR {
7276
oid_t oid;
7377
size_t pos;
7478
struct dirent *dirent;
7579
} DIR;
7680

81+
#define DIR DIR
82+
7783

7884
typedef struct _IO_cookie_io_functions
7985
{
@@ -83,6 +89,8 @@ typedef struct _IO_cookie_io_functions
8389
void *close;
8490
} cookie_io_functions_t;
8591

92+
#define cookie_io_functions_t cookie_io_functions_t
93+
8694

8795
extern FILE *stderr, *stdin, *stdout;
8896

include/stdlib.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ typedef struct
5454
} lldiv_t;
5555

5656

57+
#define div_t div_t
58+
#define ldiv_t ldiv_t
59+
#define lldiv_t lldiv_t
60+
61+
5762
/* Converts the string pointed to by the argument str to a floating-point number (type double). */
5863
extern double atof(const char *str);
5964

include/sys/socktypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@
2020

2121
typedef size_t socklen_t;
2222

23+
#define socklen_t socklen_t
24+
2325
#endif

include/syslog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ typedef struct _code {
5656
int c_val;
5757
} CODE;
5858

59+
#define CODE CODE
60+
5961
CODE prioritynames[] = {
6062
"alert", LOG_ALERT,
6163
"crit", LOG_CRIT,

include/termios.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ typedef unsigned cc_t;
3030
typedef int speed_t;
3131
typedef int tcflag_t;
3232

33+
#define cc_t cc_t
34+
#define speed_t speed_t
35+
#define tcflag_t tcflag_t
36+
3337

3438
/* c_cc characters */
3539
/* these need to be define's as various programs test them in preprocessor macros */

0 commit comments

Comments
 (0)