| 1 | module C = Configurator.V1 |
| 2 | |
| 3 | let unix = {| |
| 4 | #include <math.h> |
| 5 | void *addr = &sin; |
| 6 | int main(void) { |
| 7 | return 0; |
| 8 | } |
| 9 | |} |
| 10 | |
| 11 | let windows = {| |
| 12 | #include <winsock2.h> |
| 13 | void *addr = &gethostname; |
| 14 | int main(void) { |
| 15 | return 0; |
| 16 | } |
| 17 | |} |
| 18 | |
| 19 | let main c = |
| 20 | let code = if Sys.os_type = "Win32" then windows else unix in |
| 21 | let b = C.c_test c code in |
| 22 | let f = open_out_bin "out" in |
| 23 | output_char f (if b then '1' else '0'); |
| 24 | close_out f |
| 25 | |
| 26 | let () = C.main ~name:"configurator-c-libraries" main |