Skip to content

Commit c93a221

Browse files
committed
unix: Clean up includes.
Remove unnecessary includes. Add includes that improve portability.
1 parent 51bbf6a commit c93a221

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

unix/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#include <string.h>
21
#include <unistd.h>
32
#include <fcntl.h>
43
#include <errno.h>
4+
#include <sys/stat.h>
5+
#include <sys/types.h>
56

67
#include "nlr.h"
78
#include "misc.h"

unix/gccollect.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <stdint.h>
21
#include <stdio.h>
32

43
#include "misc.h"

unix/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#include <stdint.h>
2+
#include <stdbool.h>
23
#include <stdio.h>
34
#include <string.h>
45
#include <stdlib.h>
56
#include <stdarg.h>
7+
#include <sys/stat.h>
8+
#include <sys/types.h>
69

710
#include "nlr.h"
811
#include "misc.h"
@@ -391,8 +394,6 @@ int main(int argc, char **argv) {
391394
return 0;
392395
}
393396

394-
#include <sys/stat.h>
395-
396397
uint mp_import_stat(const char *path) {
397398
struct stat st;
398399
if (stat(path, &st) == 0) {

unix/socket.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
#include <assert.h>
33
#include <string.h>
44
#include <unistd.h>
5+
#include <sys/stat.h>
6+
#include <sys/types.h>
57
#include <sys/socket.h>
8+
#include <netinet/in.h>
69
#include <arpa/inet.h>
710
#include <netdb.h>
811
#include <errno.h>

unix/time.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <unistd.h>
12
#include <string.h>
23
#include <time.h>
34
#include <sys/time.h>

0 commit comments

Comments
 (0)