mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 21:34:18 +00:00
Tidy up multiple declarations and STDC_FOO_MACROS guards in headers.
This commit is contained in:
parent
45c74f04ab
commit
2aaca455b9
@ -1,19 +1,35 @@
|
||||
#ifndef GLOBALS_H
|
||||
#define GLOBALS_H
|
||||
#ifndef RUST_GLOBALS_H
|
||||
#define RUST_GLOBALS_H
|
||||
|
||||
#ifndef RUST_INTERNAL_H
|
||||
// these are defined in two files and GCC complains
|
||||
#ifndef __STDC_LIMIT_MACROS
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#ifndef __STDC_CONSTANT_MACROS
|
||||
#define __STDC_CONSTANT_MACROS 1
|
||||
#endif
|
||||
|
||||
#ifndef __STDC_FORMAT_MACROS
|
||||
#define __STDC_FORMAT_MACROS 1
|
||||
#endif
|
||||
|
||||
#define ERROR 0
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "rust.h"
|
||||
#include "rand.h"
|
||||
#include "uthash.h"
|
||||
#include "rust_env.h"
|
||||
|
||||
#if defined(__WIN32__)
|
||||
extern "C" {
|
||||
@ -23,14 +39,15 @@ extern "C" {
|
||||
}
|
||||
#elif defined(__GNUC__)
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#define GCC_VERSION (__GNUC__ * 10000 \
|
||||
+ __GNUC_MINOR__ * 100 \
|
||||
+ __GNUC_PATCHLEVEL__)
|
||||
|
||||
#else
|
||||
#error "Platform not supported."
|
||||
#endif
|
||||
@ -47,4 +64,4 @@ extern "C" {
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* GLOBALS_H */
|
||||
#endif /* RUST_GLOBALS_H */
|
@ -1,52 +1,7 @@
|
||||
#ifndef RUST_INTERNAL_H
|
||||
#define RUST_INTERNAL_H
|
||||
|
||||
#ifndef GLOBALS_H
|
||||
// these are defined in two files, and GCC complains.
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
#define __STDC_CONSTANT_MACROS 1
|
||||
#define __STDC_FORMAT_MACROS 1
|
||||
#endif
|
||||
|
||||
#define ERROR 0
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "rust.h"
|
||||
#include "rand.h"
|
||||
#include "uthash.h"
|
||||
#include "rust_env.h"
|
||||
|
||||
#if defined(__WIN32__)
|
||||
extern "C" {
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <wincrypt.h>
|
||||
}
|
||||
#elif defined(__GNUC__)
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#define GCC_VERSION (__GNUC__ * 10000 \
|
||||
+ __GNUC_MINOR__ * 100 \
|
||||
+ __GNUC_PATCHLEVEL__)
|
||||
|
||||
#else
|
||||
#error "Platform not supported."
|
||||
#endif
|
||||
|
||||
#include "rust_globals.h"
|
||||
#include "util/array_list.h"
|
||||
#include "util/indexed_list.h"
|
||||
#include "util/synchronized_indexed_list.h"
|
||||
@ -69,10 +24,6 @@ typedef intptr_t rust_sched_id;
|
||||
typedef intptr_t rust_task_id;
|
||||
typedef intptr_t rust_port_id;
|
||||
|
||||
//NDM #ifndef __i386__
|
||||
//NDM #error "Target CPU not supported."
|
||||
//NDM #endif
|
||||
|
||||
#define I(dom, e) ((e) ? (void)0 : \
|
||||
(dom)->srv->fatal(#e, __FILE__, __LINE__, ""))
|
||||
|
||||
|
@ -1,8 +1,3 @@
|
||||
// A workaround that makes INTPTR_MAX be visible
|
||||
#ifdef __FreeBSD__
|
||||
#define __STDC_LIMIT_MACROS 1
|
||||
#endif
|
||||
|
||||
#include "rust_internal.h"
|
||||
#include "rust_util.h"
|
||||
#include "rust_scheduler.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
|
||||
#include "globals.h"
|
||||
#include "rust_upcall.h"
|
||||
|
||||
// Tasks
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include <vector>
|
||||
#include "rust_internal.h"
|
||||
#include "rust_util.h"
|
||||
#include "globals.h"
|
||||
#include "rust_scheduler.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <assert.h>
|
||||
#include "../globals.h"
|
||||
#include "../rust_globals.h"
|
||||
|
||||
/*
|
||||
* A "lock-and-signal" pair. These are necessarily coupled on pthreads
|
||||
|
@ -5,7 +5,7 @@
|
||||
* dequeue() is not allowed to interrupt itself.
|
||||
*/
|
||||
|
||||
#include "../globals.h"
|
||||
#include "../rust_globals.h"
|
||||
#include "lock_free_queue.h"
|
||||
|
||||
lock_free_queue_node::lock_free_queue_node() : next(NULL) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "globals.h"
|
||||
#include "rust_globals.h"
|
||||
#include "rust_thread.h"
|
||||
|
||||
const size_t default_stack_sz = 1024*1024;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "../globals.h"
|
||||
#include "../rust_globals.h"
|
||||
#include "timer.h"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
Loading…
Reference in New Issue
Block a user