diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-02-08 01:53:46 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-02-08 01:53:46 +0300 |
commit | 5ca9af9e19443967160f4c785913974ac151525c (patch) | |
tree | 9db1c4e0c0a5f7cf4173c40a60308d8b15d7a57f /include/cord.h | |
parent | 40dd4e085bebcf9858a8ff0c56fd0e316f64a91a (diff) | |
download | bdwgc-5ca9af9e19443967160f4c785913974ac151525c.tar.gz |
Put variable/function declarations into extern 'C' in cord headers
Issue #201 (bdwgc).
* include/cord.h: Wrap variable and function declarations (but not
included headers).
* include/cord_pos.h: Likewise.
* include/ec.h: Likewise.
Diffstat (limited to 'include/cord.h')
-rw-r--r-- | include/cord.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/cord.h b/include/cord.h index adac772b..4ce89ffd 100644 --- a/include/cord.h +++ b/include/cord.h @@ -58,6 +58,10 @@ #include <stddef.h> #include <stdio.h> +#ifdef __cplusplus + extern "C" { +#endif + #if defined(GC_DLL) && !defined(CORD_NOT_DLL) /* Same as for GC_API in gc_config_macros.h. */ # ifdef CORD_BUILD @@ -169,6 +173,10 @@ CORD_API int CORD_riter4(CORD x, size_t i, CORD_iter_fn f1, void * client_data); /* A simpler version that starts at the end: */ CORD_API int CORD_riter(CORD x, CORD_iter_fn f1, void * client_data); +#ifdef __cplusplus + } /* extern "C" */ +#endif + /* Functions that operate on cord positions. The easy way to traverse */ /* cords. A cord position is logically a pair consisting of a cord */ /* and an index into that cord. But it is much faster to retrieve a */ @@ -181,6 +189,10 @@ CORD_API int CORD_riter(CORD x, CORD_iter_fn f1, void * client_data); /* definitions. The former may evaluate their argument more than once. */ #include "cord_pos.h" +#ifdef __cplusplus + extern "C" { +#endif + /* Visible definitions from above: @@ -312,6 +324,9 @@ CORD_API size_t CORD_chr(CORD x, size_t i, int c); /* must be < CORD_len(x). */ CORD_API size_t CORD_rchr(CORD x, size_t i, int c); +#ifdef __cplusplus + } /* extern "C" */ +#endif /* The following are also not primitive, but are implemented in */ /* cordprnt.c. They provide functionality similar to the ANSI C */ @@ -342,6 +357,10 @@ CORD_API size_t CORD_rchr(CORD x, size_t i, int c); #include <stdarg.h> +# ifdef __cplusplus + extern "C" { +# endif + CORD_API int CORD_sprintf(CORD * out, CORD format, ...); CORD_API int CORD_vsprintf(CORD * out, CORD format, va_list args); CORD_API int CORD_fprintf(FILE * f, CORD format, ...); @@ -349,6 +368,10 @@ CORD_API int CORD_vfprintf(FILE * f, CORD format, va_list args); CORD_API int CORD_printf(CORD format, ...); CORD_API int CORD_vprintf(CORD format, va_list args); +# ifdef __cplusplus + } /* extern "C" */ +# endif + #endif /* CORD_NO_IO */ #endif /* CORD_H */ |