12345678910111213141516171819202122232425262728293031(**************************************************************************)(* ocgtk - OCaml bindings for GTK4 *)(* *)(* This program is free software; you can redistribute it *)(* and/or modify it under the terms of the GNU Library General *)(* Public License version 2, as published by the *)(* Free Software Foundation with the exception described in file *)(* COPYING which comes with the library. *)(* *)(* Based on lablgtk3 (https://github.com/garrigue/lablgtk) *)(* *)(**************************************************************************)typet=privateintexternalunsafe_of_int:int->t="%identity"letmin_value=-128letmax_value=127letof_intn=ifn<min_value||n>max_valuetheninvalid_arg(Printf.sprintf"Int8.of_int: %d is out of range [%d, %d]"nmin_valuemax_value);unsafe_of_intnletto_int(v:t)=(v:>int)letmin_int=unsafe_of_intmin_valueletmax_int=unsafe_of_intmax_valueletminus_one=unsafe_of_int(-1)