Created
December 1, 2019 16:40
-
-
Save toots/5ace755d660795c39913a2509e870384 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let c_headers = " | |
#ifdef _WIN32 | |
#include <winsock2.h> | |
#include <ws2tcpip.h> | |
#else | |
#include <sys/socket.h> | |
#include <sys/un.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
#endif | |
" | |
let () = | |
let fname = Sys.argv.(1) in | |
let oc = open_out_bin fname in | |
let format = | |
Format.formatter_of_out_channel oc | |
in | |
Format.fprintf format "%s@\n" c_headers; | |
Cstubs.Types.write_c format (module Sys_socket_types.Def); | |
Format.pp_print_flush format (); | |
close_out oc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment