static void llvm_raise(value Prototype, char *Message) { CAMLparam1(Prototype); CAMLlocal1(CamlMessage); CamlMessage = copy_string(Message); LLVMDisposeMessage(Message); raise_with_arg(Prototype, CamlMessage); abort(); /* NOTREACHED */ #ifdef CAMLnoreturn CAMLnoreturn; /* Silences warnings, but is missing in some versions. */ #endif }
CAMLprim value ocaml_ssl_single_shutdown(value socket) { CAMLparam1(socket); int ret; ssl_socket_t *ssl = ssl_socket_of_block(socket); ret = SSL_shutdown(ssl->handler); if (ret == -1) { raise_with_arg(*caml_named_value("ssl_exn_shutdown_error"), Val_int(SSL_get_error(ssl->handler, ret))); }; CAMLreturn(Val_unit); }
static void caml_mpi_error_handler(MPI_Comm * comm, int * errcode, ...) { char errmsg[MPI_MAX_ERROR_STRING + 1]; int resultlen; value msg; MPI_Error_string(*errcode, errmsg, &resultlen); msg = copy_string(errmsg); if (caml_mpi_exn == NULL) { caml_mpi_exn = caml_named_value("Mpi.Error"); if (caml_mpi_exn == NULL) invalid_argument("Exception MPI.Error not initialized"); } raise_with_arg(*caml_mpi_exn, msg); }