X Tutup
Skip to content

Commit 6695ed7

Browse files
committed
api: add C++ guards
1 parent 0a0a682 commit 6695ed7

File tree

6 files changed

+38
-6
lines changed

6 files changed

+38
-6
lines changed

src/systemd/sd-bus-vtable.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
along with systemd; If not, see <http://www.gnu.org/licenses/>.
2323
***/
2424

25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
2529
typedef struct sd_bus_vtable sd_bus_vtable;
2630

2731
#include "sd-bus.h"
@@ -124,4 +128,8 @@ struct sd_bus_vtable {
124128
.type = _SD_BUS_VTABLE_END, \
125129
}
126130

131+
#ifdef __cplusplus
132+
}
133+
#endif
134+
127135
#endif

src/systemd/sd-event.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
- Handles signals and child PIDs
3838
*/
3939

40+
#ifdef __cplusplus
41+
extern "C" {
42+
#endif
43+
4044
typedef struct sd_event sd_event;
4145
typedef struct sd_event_source sd_event_source;
4246

@@ -111,4 +115,8 @@ int sd_event_source_get_time_accuracy(sd_event_source *s, uint64_t *usec);
111115
int sd_event_source_get_signal(sd_event_source *s);
112116
int sd_event_source_get_child_pid(sd_event_source *s, pid_t *pid);
113117

118+
#ifdef __cplusplus
119+
}
120+
#endif
121+
114122
#endif

src/systemd/sd-id128.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
22

3-
#ifndef fooid128hfoo
4-
#define fooid128hfoo
3+
#ifndef foosdid128hfoo
4+
#define foosdid128hfoo
55

66
/***
77
This file is part of systemd.

src/systemd/sd-journal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
22

3-
#ifndef foojournalhfoo
4-
#define foojournalhfoo
3+
#ifndef foosdjournalhfoo
4+
#define foosdjournalhfoo
55

66
/***
77
This file is part of systemd.

src/systemd/sd-rtnl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
#include <inttypes.h>
2626

27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif
30+
2731
typedef struct sd_rtnl sd_rtnl;
2832
typedef struct sd_rtnl_message sd_rtnl_message;
2933

@@ -53,4 +57,8 @@ int sd_rtnl_message_get_type(sd_rtnl_message *m, uint16_t *type);
5357
int sd_rtnl_message_append(sd_rtnl_message *m, unsigned short type, const void *data);
5458
int sd_rtnl_message_read(sd_rtnl_message *m, unsigned short *type, void **data);
5559

60+
#ifdef __cplusplus
61+
}
62+
#endif
63+
5664
#endif

src/systemd/sd-utf8.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
22

3-
#ifndef fooutf8hfoo
4-
#define fooutf8hfoo
3+
#ifndef foosdutf8hfoo
4+
#define foosdutf8hfoo
55

66
/***
77
This file is part of systemd.
@@ -22,7 +22,15 @@
2222
along with systemd; If not, see <http://www.gnu.org/licenses/>.
2323
***/
2424

25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
2529
const char *sd_utf8_is_valid(const char *s);
2630
const char *sd_ascii_is_valid(const char *s);
2731

32+
#ifdef __cplusplus
33+
}
34+
#endif
35+
2836
#endif

0 commit comments

Comments
 (0)
X Tutup