File tree Expand file tree Collapse file tree 5 files changed +37
-143
lines changed Expand file tree Collapse file tree 5 files changed +37
-143
lines changed Original file line number Diff line number Diff line change 1010
1111/* Foreign builtins. */
1212
13- #include "rust_globals.h"
1413#include "vg/valgrind.h"
1514
15+ #include <stdint.h>
1616#include <time.h>
17-
18- #ifdef __APPLE__
19- #include <TargetConditionals.h>
20- #include <mach/mach_time.h>
21-
22- #if (TARGET_OS_IPHONE )
23- extern char * * environ ;
24- #else
25- #include <crt_externs.h>
26- #endif
27- #endif
17+ #include <string.h>
18+ #include <assert.h>
19+ #include <stdlib.h>
2820
2921#if !defined(__WIN32__ )
3022#include <sys/time.h>
23+ #include <sys/types.h>
24+ #include <dirent.h>
25+ #include <signal.h>
26+ #include <unistd.h>
27+ #include <pthread.h>
28+ #else
29+ #include <windows.h>
30+ #include <wincrypt.h>
31+ #include <stdio.h>
32+ #include <tchar.h>
3133#endif
3234
33- #ifdef __FreeBSD__
34- extern char * * environ ;
35+ #ifdef __APPLE__
36+ #include <TargetConditionals.h>
37+ #include <mach/mach_time.h>
38+
39+ #if !(TARGET_OS_IPHONE )
40+ #include <crt_externs.h>
41+ #endif
3542#endif
3643
3744#ifdef __ANDROID__
@@ -57,6 +64,16 @@ timegm(struct tm *tm)
5764}
5865#endif
5966
67+ #ifdef __APPLE__
68+ #if (TARGET_OS_IPHONE )
69+ extern char * * environ ;
70+ #endif
71+ #endif
72+
73+ #if defined(__FreeBSD__ ) || defined(__linux__ ) || defined(__ANDROID__ )
74+ extern char * * environ ;
75+ #endif
76+
6077#if defined(__WIN32__ )
6178char * *
6279rust_env_pairs () {
@@ -323,8 +340,6 @@ rust_mktime(rust_tm* timeptr) {
323340}
324341
325342#ifndef _WIN32
326- #include <sys/types.h>
327- #include <dirent.h>
328343
329344DIR *
330345rust_opendir (char * dirname ) {
@@ -419,9 +434,6 @@ rust_unset_sigprocmask() {
419434
420435#else
421436
422- #include <signal.h>
423- #include <unistd.h>
424-
425437void
426438rust_unset_sigprocmask () {
427439 // this can't be safely converted to rust code because the
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1010
1111// Helper functions used only in tests
1212
13- #include "rust_globals.h"
13+ #include <stdint.h>
14+ #include <assert.h>
1415
1516// These functions are used in the unit tests for C ABI calls.
1617
Original file line number Diff line number Diff line change 1919 switch to the C stack.
2020 */
2121
22- #include "rust_globals.h"
22+ #include <stdint.h>
2323
2424//Unwinding ABI declarations.
2525typedef int _Unwind_Reason_Code ;
Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ #include <stdlib.h>
12+ #include <assert.h>
13+
1114#ifdef __WIN32__
1215// For alloca
1316#include <malloc.h>
2023
2124#include "uv.h"
2225
23- #include "rust_globals.h"
24-
2526void *
2627rust_uv_loop_new () {
2728// XXX libuv doesn't always ignore SIGPIPE even though we don't need it.
You can’t perform that action at this time.
0 commit comments