diff options
author | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2012-01-07 20:55:28 +0000 |
---|---|---|
committer | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2012-01-07 20:55:28 +0000 |
commit | 4c4a9fc507ba1eed8b9619c0ec9a70994da26cc4 (patch) | |
tree | e15a27de3d0e425b81be0eb16cec64052006501a | |
parent | 2c04ae521e148cc4f3f9c3e1c46ff41e7238af3e (diff) |
Fix of #5467: no extern C in header files
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12000 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | Changes | 3 | ||||
-rw-r--r-- | byterun/alloc.h | 8 | ||||
-rw-r--r-- | byterun/callback.h | 8 | ||||
-rw-r--r-- | byterun/custom.h | 9 | ||||
-rw-r--r-- | byterun/fail.h | 8 | ||||
-rw-r--r-- | byterun/intext.h | 8 | ||||
-rw-r--r-- | byterun/memory.h | 9 | ||||
-rw-r--r-- | byterun/mlvalues.h | 8 | ||||
-rw-r--r-- | byterun/printexc.h | 8 | ||||
-rw-r--r-- | byterun/signals.h | 8 |
10 files changed, 76 insertions, 1 deletions
@@ -38,7 +38,8 @@ Standard library: (PR#5437) Bug Fixes: -* PR#4549: Filename.dirname is not handling multiple / on Unix +* PR#5467: no extern "C" into ocaml C-stub headers +- PR#4549: Filename.dirname is not handling multiple / on Unix - PR#4869: rare collisions between assembly labels for code and data - PR#4880: "assert" constructs now show up in the exception stack backtrace - PR#5313: ocamlopt -g misses optimizations diff --git a/byterun/alloc.h b/byterun/alloc.h index 7e954e36e..75dd5ec8f 100644 --- a/byterun/alloc.h +++ b/byterun/alloc.h @@ -23,6 +23,10 @@ #include "misc.h" #include "mlvalues.h" +#ifdef __cplusplus +extern "C" { +#endif + CAMLextern value caml_alloc (mlsize_t, tag_t); CAMLextern value caml_alloc_small (mlsize_t, tag_t); CAMLextern value caml_alloc_tuple (mlsize_t); @@ -44,4 +48,8 @@ CAMLextern value caml_alloc_final (mlsize_t, /*size in words*/ CAMLextern int caml_convert_flag_list (value, int *); +#ifdef __cplusplus +} +#endif + #endif /* CAML_ALLOC_H */ diff --git a/byterun/callback.h b/byterun/callback.h index 550053add..829f6b884 100644 --- a/byterun/callback.h +++ b/byterun/callback.h @@ -23,6 +23,10 @@ #endif #include "mlvalues.h" +#ifdef __cplusplus +extern "C" { +#endif + CAMLextern value caml_callback (value closure, value arg); CAMLextern value caml_callback2 (value closure, value arg1, value arg2); CAMLextern value caml_callback3 (value closure, value arg1, value arg2, @@ -46,4 +50,8 @@ CAMLextern void caml_startup (char ** argv); CAMLextern int caml_callback_depth; +#ifdef __cplusplus +} +#endif + #endif diff --git a/byterun/custom.h b/byterun/custom.h index f71fb4fe1..c6abad8ef 100644 --- a/byterun/custom.h +++ b/byterun/custom.h @@ -43,6 +43,11 @@ struct custom_operations { #define Custom_ops_val(v) (*((struct custom_operations **) (v))) +#ifdef __cplusplus +extern "C" { +#endif + + CAMLextern value caml_alloc_custom(struct custom_operations * ops, uintnat size, /*size in bytes*/ mlsize_t mem, /*resources consumed*/ @@ -61,4 +66,8 @@ extern struct custom_operations * extern void caml_init_custom_operations(void); /* </private> */ +#ifdef __cplusplus +} +#endif + #endif /* CAML_CUSTOM_H */ diff --git a/byterun/fail.h b/byterun/fail.h index 91b2bcb7b..ee05eb7f8 100644 --- a/byterun/fail.h +++ b/byterun/fail.h @@ -58,6 +58,10 @@ int caml_is_special_exception(value exn); /* </private> */ +#ifdef __cplusplus +extern "C" { +#endif + CAMLextern void caml_raise (value bucket) Noreturn; CAMLextern void caml_raise_constant (value tag) Noreturn; CAMLextern void caml_raise_with_arg (value tag, value arg) Noreturn; @@ -75,4 +79,8 @@ CAMLextern void caml_init_exceptions (void); CAMLextern void caml_array_bound_error (void) Noreturn; CAMLextern void caml_raise_sys_blocked_io (void) Noreturn; +#ifdef __cplusplus +} +#endif + #endif /* CAML_FAIL_H */ diff --git a/byterun/intext.h b/byterun/intext.h index 05fc61441..b771a34ad 100644 --- a/byterun/intext.h +++ b/byterun/intext.h @@ -81,6 +81,10 @@ void caml_output_val (struct channel * chan, value v, value flags); /* </private> */ +#ifdef __cplusplus +extern "C" { +#endif + CAMLextern void caml_output_value_to_malloc(value v, value flags, /*out*/ char ** buf, /*out*/ intnat * len); @@ -159,4 +163,8 @@ extern char * caml_code_area_start, * caml_code_area_end; /* </private> */ +#ifdef __cplusplus +} +#endif + #endif /* CAML_INTEXT_H */ diff --git a/byterun/memory.h b/byterun/memory.h index 0c659b84e..cbeeb756f 100644 --- a/byterun/memory.h +++ b/byterun/memory.h @@ -30,6 +30,11 @@ #include "misc.h" #include "mlvalues.h" +#ifdef __cplusplus +extern "C" { +#endif + + CAMLextern value caml_alloc_shr (mlsize_t, tag_t); CAMLextern void caml_adjust_gc_speed (mlsize_t, mlsize_t); CAMLextern void caml_alloc_dependent_memory (mlsize_t); @@ -456,4 +461,8 @@ CAMLextern void caml_remove_generational_global_root (value *); CAMLextern void caml_modify_generational_global_root(value *r, value newval); +#ifdef __cplusplus +} +#endif + #endif /* CAML_MEMORY_H */ diff --git a/byterun/mlvalues.h b/byterun/mlvalues.h index 201b86bda..d560d1b3a 100644 --- a/byterun/mlvalues.h +++ b/byterun/mlvalues.h @@ -22,6 +22,10 @@ #include "config.h" #include "misc.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Definitions word: Four bytes on 32 and 16 bit architectures, @@ -294,5 +298,9 @@ CAMLextern header_t caml_atom_table[]; extern value caml_global_data; +#ifdef __cplusplus +} +#endif + #endif /* CAML_MLVALUES_H */ diff --git a/byterun/printexc.h b/byterun/printexc.h index 5b0549b23..4624086cb 100644 --- a/byterun/printexc.h +++ b/byterun/printexc.h @@ -20,8 +20,16 @@ #include "misc.h" #include "mlvalues.h" +#ifdef __cplusplus +extern "C" { +#endif + + CAMLextern char * caml_format_exception (value); void caml_fatal_uncaught_exception (value) Noreturn; +#ifdef __cplusplus +} +#endif #endif /* CAML_PRINTEXC_H */ diff --git a/byterun/signals.h b/byterun/signals.h index f771a799e..fb03b30dd 100644 --- a/byterun/signals.h +++ b/byterun/signals.h @@ -22,6 +22,10 @@ #include "misc.h" #include "mlvalues.h" +#ifdef __cplusplus +extern "C" { +#endif + /* <private> */ CAMLextern intnat volatile caml_signals_are_pending; CAMLextern intnat volatile caml_pending_signals[]; @@ -48,4 +52,8 @@ CAMLextern int (*caml_try_leave_blocking_section_hook)(void); CAMLextern void (* volatile caml_async_action_hook)(void); /* </private> */ +#ifdef __cplusplus +} +#endif + #endif /* CAML_SIGNALS_H */ |