From 091a24d53f0d130740a73b571bc4123263c1bcec Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 27 Mar 2023 00:29:58 +0200 Subject: [PATCH] C++: Add guards for relevant headers Signed-off-by: Anatol Belski --- ir.h | 8 ++++++++ ir_builder.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/ir.h b/ir.h index 9fb62bc..63109db 100644 --- a/ir.h +++ b/ir.h @@ -8,6 +8,10 @@ #ifndef IR_H #define IR_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -756,4 +760,8 @@ int ir_mem_protect(void *ptr, size_t size); int ir_mem_unprotect(void *ptr, size_t size); int ir_mem_flush(void *ptr, size_t size); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* IR_H */ diff --git a/ir_builder.h b/ir_builder.h index eb0c70e..4333e28 100644 --- a/ir_builder.h +++ b/ir_builder.h @@ -8,6 +8,10 @@ #ifndef IR_BUILDER_H #define IR_BUILDER_H +#ifdef __cplusplus +extern "C" { +#endif + /* _ir_CTX may be redefined by the user */ #define _ir_CTX ctx @@ -589,4 +593,8 @@ ir_ref _ir_SNAPSHOT(ir_ctx *ctx, ir_ref n); void _ir_SNAPSHOT_SET_OP(ir_ctx *ctx, ir_ref snapshot, ir_ref pos, ir_ref val); ir_ref _ir_EXITCALL(ir_ctx *ctx, ir_ref func); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* IR_BUILDER_H */