main zmx / src / c.h
Eric Bower  ·  2026-10-23
 1#ifndef MY_C_H
 2#define MY_C_H
 3
 4#include <stdlib.h>
 5#include <unistd.h>
 6#include <termios.h>
 7
 8#if defined(__APPLE__)
 9  #include <sys/ioctl.h>
10  #include <sys/types.h>
11
12  // Declare forkpty manually for macOS cross-compilation environments
13  // where util.h might be missing from sysroot.
14  pid_t forkpty(int *amaster, char *name, const struct termios *termp, const struct winsize *winp);
15
16#elif defined(__OpenBSD__)
17  #include <sys/types.h>
18  #include <sys/ioctl.h>
19  #include <util.h>
20
21#elif defined(__FreeBSD__)
22  #include <libutil.h>
23
24#else
25  #include <sys/ioctl.h>
26  #include <pty.h>
27
28#endif
29
30#endif // MY_C_H