Back to index

lightning-sunbird  0.9+nobinonly
jscpucfg.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator client code, released
00017  * March 31, 1998.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 1998
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #ifndef js_cpucfg___
00041 #define js_cpucfg___
00042 
00043 #include "jsosdep.h"
00044 
00045 #if defined(XP_WIN) || defined(XP_OS2) || defined(WINCE)
00046 
00047 #if defined(_WIN64)
00048 
00049 #if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
00050 #define IS_LITTLE_ENDIAN 1
00051 #undef  IS_BIG_ENDIAN
00052 
00053 #define JS_BYTES_PER_BYTE   1L
00054 #define JS_BYTES_PER_SHORT  2L
00055 #define JS_BYTES_PER_INT    4L
00056 #define JS_BYTES_PER_INT64  8L
00057 #define JS_BYTES_PER_LONG   4L
00058 #define JS_BYTES_PER_FLOAT  4L
00059 #define JS_BYTES_PER_DOUBLE 8L
00060 #define JS_BYTES_PER_WORD   8L
00061 #define JS_BYTES_PER_DWORD  8L
00062 
00063 #define JS_BITS_PER_BYTE    8L
00064 #define JS_BITS_PER_SHORT   16L
00065 #define JS_BITS_PER_INT     32L
00066 #define JS_BITS_PER_INT64   64L
00067 #define JS_BITS_PER_LONG    32L
00068 #define JS_BITS_PER_FLOAT   32L
00069 #define JS_BITS_PER_DOUBLE  64L
00070 #define JS_BITS_PER_WORD    64L
00071 
00072 #define JS_BITS_PER_BYTE_LOG2   3L
00073 #define JS_BITS_PER_SHORT_LOG2  4L
00074 #define JS_BITS_PER_INT_LOG2    5L
00075 #define JS_BITS_PER_INT64_LOG2  6L
00076 #define JS_BITS_PER_LONG_LOG2   5L
00077 #define JS_BITS_PER_FLOAT_LOG2  5L
00078 #define JS_BITS_PER_DOUBLE_LOG2 6L
00079 #define JS_BITS_PER_WORD_LOG2   6L
00080 
00081 #define JS_ALIGN_OF_SHORT   2L
00082 #define JS_ALIGN_OF_INT     4L
00083 #define JS_ALIGN_OF_LONG    4L
00084 #define JS_ALIGN_OF_INT64   8L
00085 #define JS_ALIGN_OF_FLOAT   4L
00086 #define JS_ALIGN_OF_DOUBLE  8L
00087 #define JS_ALIGN_OF_POINTER 8L
00088 #define JS_ALIGN_OF_WORD    8L
00089 
00090 #define JS_BYTES_PER_WORD_LOG2   3L
00091 #define JS_BYTES_PER_DWORD_LOG2  3L
00092 #define PR_WORDS_PER_DWORD_LOG2  0L
00093 #else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
00094 #error "CPU type is unknown"
00095 #endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
00096 
00097 #elif defined(_WIN32) || defined(XP_OS2) || defined(WINCE)
00098 
00099 #ifdef __WATCOMC__
00100 #define HAVE_VA_LIST_AS_ARRAY
00101 #endif
00102 
00103 #define IS_LITTLE_ENDIAN 1
00104 #undef  IS_BIG_ENDIAN
00105 
00106 #define JS_BYTES_PER_BYTE   1L
00107 #define JS_BYTES_PER_SHORT  2L
00108 #define JS_BYTES_PER_INT    4L
00109 #define JS_BYTES_PER_INT64  8L
00110 #define JS_BYTES_PER_LONG   4L
00111 #define JS_BYTES_PER_FLOAT  4L
00112 #define JS_BYTES_PER_DOUBLE 8L
00113 #define JS_BYTES_PER_WORD   4L
00114 #define JS_BYTES_PER_DWORD  8L
00115 
00116 #define JS_BITS_PER_BYTE    8L
00117 #define JS_BITS_PER_SHORT   16L
00118 #define JS_BITS_PER_INT     32L
00119 #define JS_BITS_PER_INT64   64L
00120 #define JS_BITS_PER_LONG    32L
00121 #define JS_BITS_PER_FLOAT   32L
00122 #define JS_BITS_PER_DOUBLE  64L
00123 #define JS_BITS_PER_WORD    32L
00124 
00125 #define JS_BITS_PER_BYTE_LOG2   3L
00126 #define JS_BITS_PER_SHORT_LOG2  4L
00127 #define JS_BITS_PER_INT_LOG2    5L
00128 #define JS_BITS_PER_INT64_LOG2  6L
00129 #define JS_BITS_PER_LONG_LOG2   5L
00130 #define JS_BITS_PER_FLOAT_LOG2  5L
00131 #define JS_BITS_PER_DOUBLE_LOG2 6L
00132 #define JS_BITS_PER_WORD_LOG2   5L
00133 
00134 #define JS_ALIGN_OF_SHORT   2L
00135 #define JS_ALIGN_OF_INT     4L
00136 #define JS_ALIGN_OF_LONG    4L
00137 #define JS_ALIGN_OF_INT64   8L
00138 #define JS_ALIGN_OF_FLOAT   4L
00139 #define JS_ALIGN_OF_DOUBLE  4L
00140 #define JS_ALIGN_OF_POINTER 4L
00141 #define JS_ALIGN_OF_WORD    4L
00142 
00143 #define JS_BYTES_PER_WORD_LOG2   2L
00144 #define JS_BYTES_PER_DWORD_LOG2  3L
00145 #define PR_WORDS_PER_DWORD_LOG2  1L
00146 #endif /* _WIN32 || XP_OS2 || WINCE*/
00147 
00148 #if defined(_WINDOWS) && !defined(_WIN32) /* WIN16 */
00149 
00150 #define IS_LITTLE_ENDIAN 1
00151 #undef  IS_BIG_ENDIAN
00152 
00153 #define JS_BYTES_PER_BYTE   1L
00154 #define JS_BYTES_PER_SHORT  2L
00155 #define JS_BYTES_PER_INT    2L
00156 #define JS_BYTES_PER_INT64  8L
00157 #define JS_BYTES_PER_LONG   4L
00158 #define JS_BYTES_PER_FLOAT  4L
00159 #define JS_BYTES_PER_DOUBLE 8L
00160 #define JS_BYTES_PER_WORD   4L
00161 #define JS_BYTES_PER_DWORD  8L
00162 
00163 #define JS_BITS_PER_BYTE    8L
00164 #define JS_BITS_PER_SHORT   16L
00165 #define JS_BITS_PER_INT     16L
00166 #define JS_BITS_PER_INT64   64L
00167 #define JS_BITS_PER_LONG    32L
00168 #define JS_BITS_PER_FLOAT   32L
00169 #define JS_BITS_PER_DOUBLE  64L
00170 #define JS_BITS_PER_WORD    32L
00171 
00172 #define JS_BITS_PER_BYTE_LOG2   3L
00173 #define JS_BITS_PER_SHORT_LOG2  4L
00174 #define JS_BITS_PER_INT_LOG2    4L
00175 #define JS_BITS_PER_INT64_LOG2  6L
00176 #define JS_BITS_PER_LONG_LOG2   5L
00177 #define JS_BITS_PER_FLOAT_LOG2  5L
00178 #define JS_BITS_PER_DOUBLE_LOG2 6L
00179 #define JS_BITS_PER_WORD_LOG2   5L
00180 
00181 #define JS_ALIGN_OF_SHORT   2L
00182 #define JS_ALIGN_OF_INT     2L
00183 #define JS_ALIGN_OF_LONG    2L
00184 #define JS_ALIGN_OF_INT64   2L
00185 #define JS_ALIGN_OF_FLOAT   2L
00186 #define JS_ALIGN_OF_DOUBLE  2L
00187 #define JS_ALIGN_OF_POINTER 2L
00188 #define JS_ALIGN_OF_WORD    2L
00189 
00190 #define JS_BYTES_PER_WORD_LOG2   2L
00191 #define JS_BYTES_PER_DWORD_LOG2  3L
00192 #define PR_WORDS_PER_DWORD_LOG2  1L
00193 
00194 #endif /* defined(_WINDOWS) && !defined(_WIN32) */
00195 
00196 #elif defined(XP_UNIX) || defined(XP_BEOS)
00197 
00198 #error "This file is supposed to be auto-generated on UNIX platforms, but the"
00199 #error "static version for Mac and Windows platforms is being used."
00200 #error "Something's probably wrong with paths/headers/dependencies/Makefiles."
00201 
00202 #else
00203 
00204 #error "Must define one of XP_BEOS, XP_OS2, XP_WIN, or XP_UNIX"
00205 
00206 #endif
00207 
00208 #ifndef JS_STACK_GROWTH_DIRECTION
00209 #define JS_STACK_GROWTH_DIRECTION (-1)
00210 #endif
00211 
00212 #endif /* js_cpucfg___ */