Skip to content

Commit a1e68de

Browse files
committed
auto merge of #10961 : brson/rust/lessc, r=alexcrichton
2 parents 32e730f + f82246f commit a1e68de

File tree

5 files changed

+37
-143
lines changed

5 files changed

+37
-143
lines changed

src/rt/rust_builtin.c

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,35 @@
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__)
6178
char**
6279
rust_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

329344
DIR*
330345
rust_opendir(char *dirname) {
@@ -419,9 +434,6 @@ rust_unset_sigprocmask() {
419434

420435
#else
421436

422-
#include <signal.h>
423-
#include <unistd.h>
424-
425437
void
426438
rust_unset_sigprocmask() {
427439
// this can't be safely converted to rust code because the

src/rt/rust_globals.h

Lines changed: 0 additions & 120 deletions
This file was deleted.

src/rt/rust_test_helpers.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
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

src/rt/rust_upcall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
switch to the C stack.
2020
*/
2121

22-
#include "rust_globals.h"
22+
#include <stdint.h>
2323

2424
//Unwinding ABI declarations.
2525
typedef int _Unwind_Reason_Code;

src/rt/rust_uv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
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>
@@ -20,8 +23,6 @@
2023

2124
#include "uv.h"
2225

23-
#include "rust_globals.h"
24-
2526
void*
2627
rust_uv_loop_new() {
2728
// XXX libuv doesn't always ignore SIGPIPE even though we don't need it.

0 commit comments

Comments
 (0)