diff --git a/fp16.h b/fp16.h index 10d2d82..1f29e8f 100644 --- a/fp16.h +++ b/fp16.h @@ -2,6 +2,12 @@ #ifndef FP16_h #define FP16_h +#ifdef __cplusplus +extern "C" { +#endif float from_half(uint16_t h); uint16_t to_half(float f); +#ifdef __cplusplus +} +#endif // __cplusplus #endif diff --git a/gguflib.h b/gguflib.h index 4cb973a..79e0d07 100644 --- a/gguflib.h +++ b/gguflib.h @@ -174,6 +174,10 @@ typedef struct { /* =============================== Prototypes =============================== */ +#ifdef __cplusplus +extern "C" { +#endif + gguf_ctx *gguf_open(const char *filename); gguf_ctx *gguf_create(const char *filename, int flags); int gguf_remap(gguf_ctx *ctx); @@ -198,4 +202,8 @@ float *gguf_tensor_to_float(gguf_tensor *tensor); int16_t *gguf_tensor_to_f16(gguf_tensor *tensor); int16_t *gguf_tensor_to_bf16(gguf_tensor *tensor); +#ifdef __cplusplus +} +#endif + #endif