Make error constants const (#292)

* Make error constants const

Rust bindgen which automatically generates bindings can now identify
this as const static data and produce a signature with the correct
mutability.

* Make error definition const too
opam-2.0.0
Jim Posen 3 years ago committed by GitHub
parent 83f907760c
commit c7cd9d8be6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -110,9 +110,9 @@ M3ImportContext, * IM3ImportContext;
// ------------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------------
# if defined(M3_IMPLEMENT_ERROR_STRINGS) # if defined(M3_IMPLEMENT_ERROR_STRINGS)
# define d_m3ErrorConst(LABEL, STRING) M3Result m3Err_##LABEL = { STRING }; # define d_m3ErrorConst(LABEL, STRING) extern const M3Result m3Err_##LABEL = { STRING };
# else # else
# define d_m3ErrorConst(LABEL, STRING) extern M3Result m3Err_##LABEL; # define d_m3ErrorConst(LABEL, STRING) extern const M3Result m3Err_##LABEL;
# endif # endif
// ------------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------------

Loading…
Cancel
Save