1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-06-17 16:25:24 +00:00

Changes to compile on macOS.

defines.h:
  Use (defined(__APPLE__) && defined(__MACH__)) to
  detect macOS, as suggested by https://stackoverflow.com/questions/7063303/macro-unix-not-defined-in-macos-x.
  Combined with __NetBSD__ to set BSD=1 and POSIX=1.

main.c:
  Include <unistd.h> to pick up sleep() declaration.
This commit is contained in:
Rob Gowin 2022-07-25 08:51:18 -04:00
parent ca23e6c394
commit db221f9705
2 changed files with 3 additions and 2 deletions

View File

@ -2,9 +2,9 @@
#ifndef __DEFINES_H__ #ifndef __DEFINES_H__
#define __DEFINES_H__ #define __DEFINES_H__
#if __unix__ #if __unix__ || (defined(__APPLE__) && defined(__MACH__))
# define UNIX 1 # define UNIX 1
# if __NetBSD__ # if __NetBSD__ || (defined(__APPLE__) && defined(__MACH__))
# define BSD 1 # define BSD 1
# define POSIX 1 # define POSIX 1
# elif __linux__ # elif __linux__

1
main.c
View File

@ -69,6 +69,7 @@
#include "defines.h" /* OS specific customization */ #include "defines.h" /* OS specific customization */
#if UNIX #if UNIX
# include <signal.h> # include <signal.h>
# include <unistd.h>
#endif #endif
#include "basic.h" #include "basic.h"