From: Pino Toscano Date: Mon, 9 Oct 2017 10:52:57 +0000 (+0200) Subject: Mark ocaml_augeas_source w/o aug_source as noreturn X-Git-Tag: v0.6~14 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=fd480bd2086c498484e735b060a1c3e80491f02d;p=ocaml-augeas.git Mark ocaml_augeas_source w/o aug_source as noreturn If aug_source is not available, the implementation of ocaml_augeas_source just raises Failure: the caml_failwith function used for that is marked as noreturn, and thus with more strict compiler flags it can fail to build. As solution, mark it as noreturn when aug_source is not available. --- diff --git a/augeas-c.c b/augeas-c.c index 64fe99b..09d3add 100644 --- a/augeas-c.c +++ b/augeas-c.c @@ -29,6 +29,12 @@ #include #include +#ifdef __GNUC__ + #define NORETURN __attribute__ ((noreturn)) +#else + #define NORETURN +#endif + extern CAMLprim value ocaml_augeas_create (value rootv, value loadpathv, value flagsv); extern CAMLprim value ocaml_augeas_close (value tv); extern CAMLprim value ocaml_augeas_get (value tv, value pathv); @@ -41,7 +47,11 @@ extern CAMLprim value ocaml_augeas_save (value tv); extern CAMLprim value ocaml_augeas_load (value tv); extern CAMLprim value ocaml_augeas_set (value tv, value pathv, value valuev); extern CAMLprim value ocaml_augeas_transform (value tv, value lensv, value filev, value modev); -extern CAMLprim value ocaml_augeas_source (value tv, value pathv); +extern CAMLprim value ocaml_augeas_source (value tv, value pathv) +#ifndef HAVE_AUG_SOURCE + NORETURN +#endif +; typedef augeas *augeas_t;