-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsdbconfigure.cpp
132 lines (112 loc) · 3.39 KB
/
jsdbconfigure.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include <stdio.h>
struct aligner { char c; void* a; };
int main(int argc, char** argv)
{
printf("#ifndef js_config_h__\n");
printf("#define js_config_h__\n");
int bpw = sizeof(void*);
printf("#define JS_BYTES_PER_WORD %d\n",bpw);
int sow = sizeof(double);
printf("#define JS_BYTES_PER_DOUBLE %d\n",sow);
if (bpw == 4)
printf("#define JS_BITS_PER_WORD_LOG2 5\n");
else if (bpw == 8)
{
printf("#define JS_BITS_PER_WORD_LOG2 6\n");
printf("#define AVMPLUS_64BIT\n");
}
aligner al;
int aop = (char*)(void*)(&al.a) - (char*)(void*)(&al.c);
printf("#define JS_ALIGN_OF_POINTER %d\n",aop);
#ifdef _MSC_VER
printf("#define JS_HAVE___INTN 1\n");
printf("#define JS_STDDEF_H_HAS_INTPTR_T 1\n");
#endif
#ifdef WIN32
printf("#define HAVE_GETSYSTEMTIMEASFILETIME 1\n");
printf("#define HAVE_SYSTEMTIMETOFILETIME 1\n");
#elif defined WIN64
printf("#define HAVE_GETSYSTEMTIMEASFILETIME 1\n");
printf("#define HAVE_SYSTEMTIMETOFILETIME 1\n");
#else
printf("#ifdef XP_MACOSX\n");
printf("#define HAVE_VA_LIST_AS_ARRAY 1\n");
printf("#endif\n");
printf("#ifdef __x86_64__ \n");
printf("#define HAVE_VA_LIST_AS_ARRAY 1\n");
printf("#endif\n");
#endif
#ifdef __sun__
/* in js/src/jsstdint.h, insert:
#if defined(JS_HAVE_INTTYPES_H)
#include <inttypes.h>
#elif defined(JS_HAVE_STDINT_H)
#include <stdint.h>
*/
printf("#define JS_HAVE_INTTYPES_H\n");
#else
printf("#define JS_HAVE_STDINT_H\n");
#endif
// printf("#define JS_TRACER\n");
// printf("#define FEATURE_NANOJIT\n");
printf("#define STATIC_JS_API\n");
printf("#endif\n");
printf("#define _vprof(v)\n");
printf("#define _nvprof(n,v)\n");
printf("#define _hprof(h)\n");
printf("#define _nhprof(n,h)\n");
}
#if 0
js-config.h
/* Define to 1 if SpiderMonkey should support multi-threaded clients. */
#undef JS_THREADSAFE
/* Define to 1 if SpiderMonkey should support the ability to perform
entirely too much GC. */
#undef JS_GC_ZEAL
/* Define to 1 if the standard <stdint.h> header is present and
useable. See jstypes.h and jsstdint.h. */
#undef JS_HAVE_STDINT_H
/* Define to 1 if the N-byte __intN types are defined by the
compiler. */
#undef JS_HAVE___INTN
/* Define to 1 if #including <stddef.h> provides definitions for
intptr_t and uintptr_t. */
#undef JS_STDDEF_H_HAS_INTPTR_T
/* Define to 1 if #including <crtdefs.h> provides definitions for
intptr_t and uintptr_t. */
#undef JS_CRTDEFS_H_HAS_INTPTR_T
/* The configure script defines these if it doesn't #define
JS_HAVE_STDINT_H. */
#undef JS_INT8_TYPE
#undef JS_INT16_TYPE
#undef JS_INT32_TYPE
#undef JS_INT64_TYPE
#undef JS_INTPTR_TYPE
#undef JS_BYTES_PER_WORD
/* Some mozilla code uses JS-friend APIs that depend on JS_TRACER being
correct. */
#undef JS_TRACER
#endif
#if 0
jscpucfg.h
32-bit
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
#define JS_BYTES_PER_DOUBLE 8L
#define JS_BYTES_PER_WORD 4L
#define JS_BITS_PER_WORD_LOG2 5
#define JS_ALIGN_OF_POINTER 4L
64-bit
#define JS_BYTES_PER_WORD 8L
#define JS_BITS_PER_WORD_LOG2 6
#define JS_ALIGN_OF_POINTER 8L
stdint.h
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif