diff options
Diffstat (limited to 'scripts/basic')
| -rw-r--r-- | scripts/basic/fixdep.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index f27a17984..02678a4cc 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
| @@ -104,7 +104,9 @@ | |||
| 104 | 104 | ||
| 105 | #include <sys/types.h> | 105 | #include <sys/types.h> |
| 106 | #include <sys/stat.h> | 106 | #include <sys/stat.h> |
| 107 | #ifndef __MINGW32__ | ||
| 107 | #include <sys/mman.h> | 108 | #include <sys/mman.h> |
| 109 | #endif | ||
| 108 | #include <unistd.h> | 110 | #include <unistd.h> |
| 109 | #include <fcntl.h> | 111 | #include <fcntl.h> |
| 110 | #include <string.h> | 112 | #include <string.h> |
| @@ -112,7 +114,9 @@ | |||
| 112 | #include <stdio.h> | 114 | #include <stdio.h> |
| 113 | #include <limits.h> | 115 | #include <limits.h> |
| 114 | #include <ctype.h> | 116 | #include <ctype.h> |
| 117 | #ifndef __MINGW32__ | ||
| 115 | #include <arpa/inet.h> | 118 | #include <arpa/inet.h> |
| 119 | #endif | ||
| 116 | 120 | ||
| 117 | /* bbox: not needed | 121 | /* bbox: not needed |
| 118 | #define INT_CONF ntohl(0x434f4e46) | 122 | #define INT_CONF ntohl(0x434f4e46) |
| @@ -121,6 +125,31 @@ | |||
| 121 | #define INT_FIG_ ntohl(0x4649475f) | 125 | #define INT_FIG_ ntohl(0x4649475f) |
| 122 | */ | 126 | */ |
| 123 | 127 | ||
| 128 | #ifdef __MINGW32__ | ||
| 129 | #define UNUSED __attribute__ ((__unused__)) | ||
| 130 | |||
| 131 | /* Workaround specifically for fixdep */ | ||
| 132 | #define PROT_READ 0 | ||
| 133 | #define MAP_PRIVATE 0 | ||
| 134 | void *mmap(void *start UNUSED, size_t size, int prot UNUSED, | ||
| 135 | int flags UNUSED, int fd, off_t offset UNUSED) | ||
| 136 | { | ||
| 137 | void *p = malloc(size); | ||
| 138 | if (!p) | ||
| 139 | return NULL; | ||
| 140 | if (read(fd, p, size) != size) { | ||
| 141 | perror("fixdep: read config"); | ||
| 142 | free(p); | ||
| 143 | return NULL; | ||
| 144 | } | ||
| 145 | return p; | ||
| 146 | } | ||
| 147 | void munmap(void *p, size_t size UNUSED) | ||
| 148 | { | ||
| 149 | free(p); | ||
| 150 | } | ||
| 151 | #endif | ||
| 152 | |||
| 124 | char *target; | 153 | char *target; |
| 125 | char *depfile; | 154 | char *depfile; |
| 126 | char *cmdline; | 155 | char *cmdline; |
