1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jscpucfg.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,112 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * vim: set ts=8 sts=4 et sw=4 tw=99: 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef jscpucfg_h 1.11 +#define jscpucfg_h 1.12 + 1.13 +#define JS_HAVE_LONG_LONG 1.14 + 1.15 +#if defined(_WIN64) 1.16 + 1.17 +# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_) 1.18 +# define IS_LITTLE_ENDIAN 1 1.19 +# undef IS_BIG_ENDIAN 1.20 +# else /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */ 1.21 +# error "CPU type is unknown" 1.22 +# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */ 1.23 + 1.24 +#elif defined(_WIN32) 1.25 + 1.26 +# ifdef __WATCOMC__ 1.27 +# define HAVE_VA_LIST_AS_ARRAY 1 1.28 +# endif 1.29 + 1.30 +# define IS_LITTLE_ENDIAN 1 1.31 +# undef IS_BIG_ENDIAN 1.32 + 1.33 +#elif defined(__APPLE__) || defined(__powerpc__) || defined(__ppc__) 1.34 +# if __LITTLE_ENDIAN__ 1.35 +# define IS_LITTLE_ENDIAN 1 1.36 +# undef IS_BIG_ENDIAN 1.37 +# elif __BIG_ENDIAN__ 1.38 +# undef IS_LITTLE_ENDIAN 1.39 +# define IS_BIG_ENDIAN 1 1.40 +# endif 1.41 + 1.42 +#elif defined(JS_HAVE_ENDIAN_H) 1.43 +# include <endian.h> 1.44 + 1.45 +# if defined(__BYTE_ORDER) 1.46 +# if __BYTE_ORDER == __LITTLE_ENDIAN 1.47 +# define IS_LITTLE_ENDIAN 1 1.48 +# undef IS_BIG_ENDIAN 1.49 +# elif __BYTE_ORDER == __BIG_ENDIAN 1.50 +# undef IS_LITTLE_ENDIAN 1.51 +# define IS_BIG_ENDIAN 1 1.52 +# endif 1.53 +# else /* !defined(__BYTE_ORDER) */ 1.54 +# error "endian.h does not define __BYTE_ORDER. Cannot determine endianness." 1.55 +# endif 1.56 + 1.57 +/* BSDs */ 1.58 +#elif defined(JS_HAVE_MACHINE_ENDIAN_H) 1.59 +# include <sys/types.h> 1.60 +# include <machine/endian.h> 1.61 + 1.62 +# if defined(_BYTE_ORDER) 1.63 +# if _BYTE_ORDER == _LITTLE_ENDIAN 1.64 +# define IS_LITTLE_ENDIAN 1 1.65 +# undef IS_BIG_ENDIAN 1.66 +# elif _BYTE_ORDER == _BIG_ENDIAN 1.67 +# undef IS_LITTLE_ENDIAN 1.68 +# define IS_BIG_ENDIAN 1 1.69 +# endif 1.70 +# else /* !defined(_BYTE_ORDER) */ 1.71 +# error "machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness." 1.72 +# endif 1.73 + 1.74 +#elif defined(JS_HAVE_SYS_ISA_DEFS_H) 1.75 +# include <sys/isa_defs.h> 1.76 + 1.77 +# if defined(_BIG_ENDIAN) 1.78 +# undef IS_LITTLE_ENDIAN 1.79 +# define IS_BIG_ENDIAN 1 1.80 +# elif defined(_LITTLE_ENDIAN) 1.81 +# define IS_LITTLE_ENDIAN 1 1.82 +# undef IS_BIG_ENDIAN 1.83 +# else /* !defined(_LITTLE_ENDIAN) */ 1.84 +# error "sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness." 1.85 +# endif 1.86 +# if !defined(JS_STACK_GROWTH_DIRECTION) 1.87 +# if defined(_STACK_GROWS_UPWARD) 1.88 +# define JS_STACK_GROWTH_DIRECTION (1) 1.89 +# elif defined(_STACK_GROWS_DOWNWARD) 1.90 +# define JS_STACK_GROWTH_DIRECTION (-1) 1.91 +# endif 1.92 +# endif 1.93 + 1.94 +#elif defined(__sparc) || defined(__sparc__) || \ 1.95 + defined(_POWER) || defined(__hppa) || \ 1.96 + defined(_MIPSEB) || defined(_BIG_ENDIAN) 1.97 +/* IA64 running HP-UX will have _BIG_ENDIAN defined. 1.98 + * IA64 running Linux will have endian.h and be handled above. 1.99 + */ 1.100 +# undef IS_LITTLE_ENDIAN 1.101 +# define IS_BIG_ENDIAN 1 1.102 + 1.103 +#else /* !defined(__sparc) && !defined(__sparc__) && ... */ 1.104 +# error "Cannot determine endianness of your platform. Please add support to jscpucfg.h." 1.105 +#endif 1.106 + 1.107 +#ifndef JS_STACK_GROWTH_DIRECTION 1.108 +# ifdef __hppa 1.109 +# define JS_STACK_GROWTH_DIRECTION (1) 1.110 +# else 1.111 +# define JS_STACK_GROWTH_DIRECTION (-1) 1.112 +# endif 1.113 +#endif 1.114 + 1.115 +#endif /* jscpucfg_h */