From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 4520C7F30A for ; Fri, 1 Mar 2013 12:06:23 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of christoph.bauer@lmsintl.com) identity=pra; client-ip=193.109.254.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.bauer@lmsintl.com"; x-sender="christoph.bauer@lmsintl.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of christoph.bauer@lmsintl.com designates 193.109.254.112 as permitted sender) identity=mailfrom; client-ip=193.109.254.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.bauer@lmsintl.com"; x-sender="christoph.bauer@lmsintl.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail1.bemta14.messagelabs.com) identity=helo; client-ip=193.109.254.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="christoph.bauer@lmsintl.com"; x-sender="postmaster@mail1.bemta14.messagelabs.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvUBAH+KMFHBbf5wkWdsb2JhbABFwjN/Fg4BAQEBFBIUJ4ImOlEBPkImAQQbiA+gBY1jAQGTEI5jgxdhA5xcjVuCJg X-IPAS-Result: AvUBAH+KMFHBbf5wkWdsb2JhbABFwjN/Fg4BAQEBFBIUJ4ImOlEBPkImAQQbiA+gBY1jAQGTEI5jgxdhA5xcjVuCJg X-IronPort-AV: E=Sophos;i="4.84,761,1355094000"; d="scan'208";a="5016777" Received: from mail1.bemta14.messagelabs.com ([193.109.254.112]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Mar 2013 12:06:22 +0100 Received: from [85.158.140.195:34137] by server-8.bemta-14.messagelabs.com id 05/6E-17325-CAB80315; Fri, 01 Mar 2013 11:06:20 +0000 X-Env-Sender: christoph.bauer@lmsintl.com X-Msg-Ref: server-12.tower-193.messagelabs.com!1362135979!12129584!1 X-Originating-IP: [217.110.84.214] X-StarScan-Received: X-StarScan-Version: 6.8.6; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11469 invoked from network); 1 Mar 2013 11:06:20 -0000 Received: from unknown (HELO KAIP-EXHUB01.lmsintl.com) (217.110.84.214) by server-12.tower-193.messagelabs.com with RC4-SHA encrypted SMTP; 1 Mar 2013 11:06:20 -0000 Received: from KAIP-EXMSG01.lmsintl.com ([10.2.100.91]) by KAIP-EXHUB01.lmsintl.com ([10.2.100.90]) with mapi; Fri, 1 Mar 2013 12:06:12 +0100 From: Christoph Bauer To: caml-list Date: Fri, 1 Mar 2013 12:06:12 +0100 Thread-Topic: C Interface question about failwith Thread-Index: Ac4WbBBBfuOpo3fmS0ijKS6hG3KwyQ== Message-ID: <9A8556989A396A408C72088C69EDE56308AE441AFF@KAIP-EXMSG01.lmsintl.com> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [Caml-list] C Interface question about failwith Hi, In C code I have a malloced-string error message, which must be freed. But = I want also raise an OCaml exception with this string. Actually what I need something like this: static void failwith_string_value(value msg) { CAMLparam1(msg); caml_raise_with_arg(Field(caml_global_data, FAILURE_EXN), msg); CAMLnoreturn; } Then I could do: =20=20 msg =3D caml_copy_string(s); free(s); failwith_string_value(msg); But FAILURE_EXN is not defined in fail.h and more important caml_global_data is defined in mlvalues.h, but I get an undefined reference= link error. Any ideas how to solve such a problem? Thanks, Christoph Bauer =20=20=20=20