Skip to content

Commit cacaf51

Browse files
committed
FIX: avoid redefinition of typedef warnings when using amalgamated extension includes with -std=c99 compilation flag
1 parent 5b6e840 commit cacaf51

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/include/reb-device.h

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
**
2828
***********************************************************************/
2929

30+
#ifndef DEVICE_H
31+
#define DEVICE_H
32+
3033
// REBOL Device Identifiers:
3134
// Critical: Must be in same order as Device table in host-device.c
3235
enum {
@@ -118,8 +121,10 @@ enum {
118121
#pragma pack(4)
119122

120123
// Forward references:
124+
#ifndef REB_EVENT_H
121125
typedef struct rebol_device REBDEV;
122126
typedef struct rebol_devreq REBREQ;
127+
#endif
123128

124129
// Commands:
125130
typedef i32 (*DEVICE_CMD_FUNC)(REBREQ *req);
@@ -208,3 +213,5 @@ struct rebol_devreq {
208213
#define SET_OPEN(r) SET_FLAG(((REBREQ*)(r))->flags, RRF_OPEN)
209214
#define SET_CLOSED(r) CLR_FLAG(((REBREQ*)(r))->flags, RRF_OPEN)
210215
#define IS_OPEN(r) GET_FLAG(((REBREQ*)(r))->flags, RRF_OPEN)
216+
217+
#endif //DEVICE_H

src/include/reb-event.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@
3232
// Note: size must be 12 bytes on 32-bit or 16 on 64-bit!
3333

3434
// Forward references:
35+
#ifndef VALUE_H
36+
typedef struct Reb_Series REBSER;
37+
#endif
38+
#ifndef DEVICE_H
3539
typedef struct rebol_device REBDEV;
3640
typedef struct rebol_devreq REBREQ;
37-
typedef struct Reb_Series REBSER;
41+
#endif
3842

3943
#pragma pack(4)
4044
typedef struct rebol_event {

0 commit comments

Comments
 (0)