Skip to content

Remove rust_globals.h #10961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 25, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions src/rt/rust_builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,35 @@

/* Foreign builtins. */

#include "rust_globals.h"
#include "vg/valgrind.h"

#include <stdint.h>
#include <time.h>

#ifdef __APPLE__
#include <TargetConditionals.h>
#include <mach/mach_time.h>

#if (TARGET_OS_IPHONE)
extern char **environ;
#else
#include <crt_externs.h>
#endif
#endif
#include <string.h>
#include <assert.h>
#include <stdlib.h>

#if !defined(__WIN32__)
#include <sys/time.h>
#include <sys/types.h>
#include <dirent.h>
#include <signal.h>
#include <unistd.h>
#include <pthread.h>
#else
#include <windows.h>
#include <wincrypt.h>
#include <stdio.h>
#include <tchar.h>
#endif

#ifdef __FreeBSD__
extern char **environ;
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <mach/mach_time.h>

#if !(TARGET_OS_IPHONE)
#include <crt_externs.h>
#endif
#endif

#ifdef __ANDROID__
Expand All @@ -57,6 +64,16 @@ timegm(struct tm *tm)
}
#endif

#ifdef __APPLE__
#if (TARGET_OS_IPHONE)
extern char **environ;
#endif
#endif

#if defined(__FreeBSD__) || defined(__linux__) || defined(__ANDROID__)
extern char **environ;
#endif

#if defined(__WIN32__)
char**
rust_env_pairs() {
Expand Down Expand Up @@ -323,8 +340,6 @@ rust_mktime(rust_tm* timeptr) {
}

#ifndef _WIN32
#include <sys/types.h>
#include <dirent.h>

DIR*
rust_opendir(char *dirname) {
Expand Down Expand Up @@ -419,9 +434,6 @@ rust_unset_sigprocmask() {

#else

#include <signal.h>
#include <unistd.h>

void
rust_unset_sigprocmask() {
// this can't be safely converted to rust code because the
Expand Down
120 changes: 0 additions & 120 deletions src/rt/rust_globals.h

This file was deleted.

3 changes: 2 additions & 1 deletion src/rt/rust_test_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

// Helper functions used only in tests

#include "rust_globals.h"
#include <stdint.h>
#include <assert.h>

// These functions are used in the unit tests for C ABI calls.

Expand Down
2 changes: 1 addition & 1 deletion src/rt/rust_upcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
switch to the C stack.
*/

#include "rust_globals.h"
#include <stdint.h>

//Unwinding ABI declarations.
typedef int _Unwind_Reason_Code;
Expand Down
5 changes: 3 additions & 2 deletions src/rt/rust_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#include <stdlib.h>
#include <assert.h>

#ifdef __WIN32__
// For alloca
#include <malloc.h>
Expand All @@ -20,8 +23,6 @@

#include "uv.h"

#include "rust_globals.h"

void*
rust_uv_loop_new() {
// XXX libuv doesn't always ignore SIGPIPE even though we don't need it.
Expand Down