The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #14426 from dra27/tidy-unistd

Remove unnecessary guards on `unistd.h`

authored by

Gabriel Scherer and committed by
GitHub
9703b346 6fef1251

+10 -64
-2
otherlibs/systhreads/st_pthreads.h
··· 22 22 #include <pthread.h> 23 23 #include <signal.h> 24 24 #include <time.h> 25 - #ifndef _WIN32 26 25 #include <unistd.h> 27 - #endif 28 26 29 27 30 28 typedef pthread_t st_thread_id;
-2
otherlibs/unix/caml/unixsupport.h
··· 30 30 #include <ws2tcpip.h> 31 31 #include <wspiapi.h> 32 32 #else /* Unix */ 33 - #ifndef _WIN32 34 33 #include <unistd.h> 35 - #endif 36 34 #endif 37 35 38 36 #ifdef __cplusplus
-2
otherlibs/unix/envir_unix.c
··· 15 15 16 16 #include <caml/config.h> 17 17 18 - #ifndef _WIN32 19 18 #include <unistd.h> 20 - #endif 21 19 #include <sys/types.h> 22 20 #ifdef HAS_GETAUXVAL 23 21 #include <sys/auxv.h>
-2
otherlibs/unix/fcntl.c
··· 16 16 #include <caml/fail.h> 17 17 #include <caml/mlvalues.h> 18 18 #include "caml/unixsupport.h" 19 - #ifndef _WIN32 20 19 #include <unistd.h> 21 - #endif 22 20 #include <fcntl.h> 23 21 24 22 #ifndef O_NONBLOCK
+3 -4
otherlibs/unix/ftruncate.c
··· 15 15 16 16 #define CAML_INTERNALS 17 17 18 - #include <sys/types.h> 19 18 #include <caml/fail.h> 20 19 #include <caml/mlvalues.h> 21 20 #include <caml/io.h> 22 21 #include <caml/signals.h> 23 22 #include "caml/unixsupport.h" 24 - #ifndef _WIN32 25 - #include <unistd.h> 26 - #endif 27 23 28 24 #ifdef HAS_TRUNCATE 25 + 26 + #include <sys/types.h> 27 + #include <unistd.h> 29 28 30 29 CAMLprim value caml_unix_ftruncate(value fd, value len) 31 30 {
-2
otherlibs/unix/getgroups.c
··· 21 21 #ifdef HAS_GETGROUPS 22 22 23 23 #include <sys/types.h> 24 - #ifndef _WIN32 25 24 #include <unistd.h> 26 - #endif 27 25 #include <errno.h> 28 26 #include "caml/unixsupport.h" 29 27
-2
otherlibs/unix/initgroups.c
··· 20 20 #ifdef HAS_INITGROUPS 21 21 22 22 #include <sys/types.h> 23 - #ifndef _WIN32 24 23 #include <unistd.h> 25 - #endif 26 24 #include <errno.h> 27 25 #include <limits.h> 28 26 #include <grp.h>
-7
otherlibs/unix/lockf_unix.c
··· 87 87 #else 88 88 89 89 #ifdef HAS_LOCKF 90 - #ifndef _WIN32 91 90 #include <unistd.h> 92 - #else 93 - #define F_ULOCK 0 94 - #define F_LOCK 1 95 - #define F_TLOCK 2 96 - #define F_TEST 3 97 - #endif 98 91 99 92 static const int lock_command_table[] = { 100 93 F_ULOCK, F_LOCK, F_TLOCK, F_TEST, F_LOCK, F_TLOCK
-6
otherlibs/unix/lseek_unix.c
··· 23 23 #include <caml/signals.h> 24 24 #include "caml/unixsupport.h" 25 25 26 - #ifndef _WIN32 27 26 #include <unistd.h> 28 - #else 29 - #define SEEK_SET 0 30 - #define SEEK_CUR 1 31 - #define SEEK_END 2 32 - #endif 33 27 34 28 #ifndef EOVERFLOW 35 29 #define EOVERFLOW ERANGE
-8
otherlibs/unix/lseek_win32.c
··· 18 18 #include <caml/signals.h> 19 19 #include "caml/unixsupport.h" 20 20 21 - #ifndef _WIN32 22 - #include <unistd.h> 23 - #else 24 - #define SEEK_SET 0 25 - #define SEEK_CUR 1 26 - #define SEEK_END 2 27 - #endif 28 - 29 21 static const DWORD seek_command_table[] = { 30 22 FILE_BEGIN, FILE_CURRENT, FILE_END 31 23 };
-2
otherlibs/unix/mmap_unix.c
··· 29 29 #include "caml/unixsupport.h" 30 30 31 31 #include <errno.h> 32 - #ifndef _WIN32 33 32 #include <unistd.h> 34 - #endif 35 33 #ifdef HAS_MMAP 36 34 #include <sys/types.h> 37 35 #include <sys/mman.h>
-2
otherlibs/unix/nice.c
··· 16 16 #include <caml/mlvalues.h> 17 17 #include "caml/unixsupport.h" 18 18 #include <errno.h> 19 - #ifndef _WIN32 20 19 #include <unistd.h> 21 - #endif 22 20 23 21 CAMLprim value caml_unix_nice(value incr) 24 22 {
-2
otherlibs/unix/open_unix.c
··· 20 20 #include <caml/signals.h> 21 21 #include "caml/unixsupport.h" 22 22 #include <string.h> 23 - #ifndef _WIN32 24 23 #include <unistd.h> 25 - #endif 26 24 #include <fcntl.h> 27 25 28 26 #ifndef O_NONBLOCK
-2
otherlibs/unix/setgroups.c
··· 21 21 #ifdef HAS_SETGROUPS 22 22 23 23 #include <sys/types.h> 24 - #ifndef _WIN32 25 24 #include <unistd.h> 26 - #endif 27 25 #include <limits.h> 28 26 #include <grp.h> 29 27 #include "caml/unixsupport.h"
-2
otherlibs/unix/setsid.c
··· 16 16 #include <caml/fail.h> 17 17 #include <caml/mlvalues.h> 18 18 #include "caml/unixsupport.h" 19 - #ifndef _WIN32 20 19 #include <unistd.h> 21 - #endif 22 20 23 21 CAMLprim value caml_unix_setsid(value unit) 24 22 {
+2 -3
otherlibs/unix/truncate_unix.c
··· 22 22 #include <caml/signals.h> 23 23 #include <caml/io.h> 24 24 #include "caml/unixsupport.h" 25 - #ifndef _WIN32 26 - #include <unistd.h> 27 - #endif 28 25 29 26 #ifdef HAS_TRUNCATE 27 + 28 + #include <unistd.h> 30 29 31 30 CAMLprim value caml_unix_truncate(value path, value vlen) 32 31 {
-2
otherlibs/unix/unixsupport_unix.c
··· 24 24 #include "caml/unixsupport.h" 25 25 #include "cst2constr.h" 26 26 #include <errno.h> 27 - #ifndef _WIN32 28 27 #include <unistd.h> 29 - #endif 30 28 #include <fcntl.h> 31 29 32 30 #ifndef E2BIG
+1 -2
runtime/backtrace_byt.c
··· 25 25 #include "caml/config.h" 26 26 #ifndef _WIN32 27 27 #include <unistd.h> 28 - #endif 29 - #ifdef _WIN32 28 + #else 30 29 #include <io.h> 31 30 #endif 32 31
+1 -3
runtime/debugger.c
··· 63 63 64 64 #else 65 65 66 - #ifndef _WIN32 67 - #include <unistd.h> 68 - #endif 69 66 #include <errno.h> 70 67 #include <stdlib.h> 71 68 #include <sys/types.h> 72 69 #ifndef _WIN32 70 + #include <unistd.h> 73 71 #include <sys/wait.h> 74 72 #include <sys/socket.h> 75 73 #include <sys/un.h>
+1 -2
runtime/dynlink.c
··· 25 25 #include "caml/config.h" 26 26 #ifndef _WIN32 27 27 #include <unistd.h> 28 - #endif 29 - #ifdef _WIN32 28 + #else 30 29 #include <io.h> 31 30 #endif 32 31 #include "caml/alloc.h"
+1 -2
runtime/startup_byt.c
··· 25 25 #include "caml/config.h" 26 26 #ifndef _WIN32 27 27 #include <unistd.h> 28 - #endif 29 - #ifdef _WIN32 28 + #else 30 29 #include <io.h> 31 30 #include <process.h> 32 31 #endif
+1 -3
runtime/sys.c
··· 31 31 #include <io.h> /* for _wopen and close */ 32 32 #else 33 33 #include <sys/wait.h> 34 - #endif 35 - #include "caml/config.h" 36 - #ifndef _WIN32 37 34 #include <unistd.h> 38 35 #endif 36 + #include "caml/config.h" 39 37 #ifdef HAS_TIMES 40 38 #include <sys/times.h> 41 39 #endif