Skip to content

Commit ea534e3

Browse files
authored
Make CDistributedActorsMailbox compatible with C++ interop (#1214)
1 parent 0041f6a commit ea534e3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Sources/CDistributedActorsMailbox/include/backtrace_support.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#ifndef SACT_BACKTRACE_SUPPORT_H
1616
#define SACT_BACKTRACE_SUPPORT_H
1717

18+
#ifdef __cplusplus
19+
extern "C" {
20+
#endif
21+
1822
/**
1923
* Prints a stack backtrace directly to `stderr`.
2024
* Use only internally, mostly for
@@ -26,4 +30,8 @@ void sact_dump_backtrace(void);
2630

2731
int sact_get_backtrace(char*** strs);
2832

33+
#if defined(__cplusplus)
34+
} // extern "C"
35+
#endif
36+
2937
#endif

Sources/CDistributedActorsMailbox/include/c_mpsc_linked_queue.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
#include <stdatomic.h>
1919
#include <stdlib.h>
2020

21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
2125
typedef struct Node {
2226
void* item;
2327
_Atomic (struct Node*) next;
@@ -39,4 +43,8 @@ void c_sact_mpsc_linked_queue_enqueue(CSActMPSCLinkedQueue* q, void* item);
3943

4044
void* c_sact_mpsc_linked_queue_dequeue(CSActMPSCLinkedQueue* q);
4145

46+
#if defined(__cplusplus)
47+
} // extern "C"
48+
#endif
49+
4250
#endif /* CMPSCLinkedQueue_h */

0 commit comments

Comments
 (0)