File: pyml_arch.ml.c

package info (click to toggle)
pyml 20231101-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 592 kB
  • sloc: ml: 7,043; ansic: 1,802; makefile: 317; sh: 13
file content (20 lines) | stat: -rw-r--r-- 433 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#if __APPLE__
  #define PLATFORM_NAME Mac
#elif defined(WIN32) || defined(_WIN32)
  #define PLATFORM_NAME Windows
  #define WIN_HANDLE_FD
#elif unix
  #define PLATFORM_NAME Unix
#else
  #error "Unknown platform"
#endif

type t = Windows | Mac | Unix

let os = PLATFORM_NAME

#ifdef WIN_HANDLE_FD
  external fd_of_int : int -> Unix.file_descr = "win_handle_fd"
#else
  external fd_of_int : int -> Unix.file_descr = "%identity"
#endif