andre@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #ifndef nspr_cpucfg___ andre@0: #define nspr_cpucfg___ andre@0: andre@0: #ifndef XP_PC andre@0: #define XP_PC andre@0: #endif andre@0: andre@0: #ifndef WIN32 andre@0: #define WIN32 andre@0: #endif andre@0: andre@0: #ifndef WIN95 andre@0: #define WIN95 andre@0: #endif andre@0: andre@0: #define PR_AF_INET6 23 /* same as AF_INET6 */ andre@0: andre@0: #if defined(_M_IX86) || defined(_X86_) andre@0: andre@0: #define IS_LITTLE_ENDIAN 1 andre@0: #undef IS_BIG_ENDIAN andre@0: andre@0: #define PR_BYTES_PER_BYTE 1 andre@0: #define PR_BYTES_PER_SHORT 2 andre@0: #define PR_BYTES_PER_INT 4 andre@0: #define PR_BYTES_PER_INT64 8 andre@0: #define PR_BYTES_PER_LONG 4 andre@0: #define PR_BYTES_PER_FLOAT 4 andre@0: #define PR_BYTES_PER_WORD 4 andre@0: #define PR_BYTES_PER_DWORD 8 andre@0: #define PR_BYTES_PER_DOUBLE 8 andre@0: andre@0: #define PR_BITS_PER_BYTE 8 andre@0: #define PR_BITS_PER_SHORT 16 andre@0: #define PR_BITS_PER_INT 32 andre@0: #define PR_BITS_PER_INT64 64 andre@0: #define PR_BITS_PER_LONG 32 andre@0: #define PR_BITS_PER_FLOAT 32 andre@0: #define PR_BITS_PER_WORD 32 andre@0: #define PR_BITS_PER_DWORD 64 andre@0: #define PR_BITS_PER_DOUBLE 64 andre@0: andre@0: #define PR_BITS_PER_BYTE_LOG2 3 andre@0: #define PR_BITS_PER_SHORT_LOG2 4 andre@0: #define PR_BITS_PER_INT_LOG2 5 andre@0: #define PR_BITS_PER_INT64_LOG2 6 andre@0: #define PR_BITS_PER_LONG_LOG2 5 andre@0: #define PR_BITS_PER_FLOAT_LOG2 5 andre@0: #define PR_BITS_PER_WORD_LOG2 5 andre@0: #define PR_BITS_PER_DWORD_LOG2 6 andre@0: #define PR_BITS_PER_DOUBLE_LOG2 6 andre@0: andre@0: #define PR_ALIGN_OF_SHORT 2 andre@0: #define PR_ALIGN_OF_INT 4 andre@0: #define PR_ALIGN_OF_LONG 4 andre@0: #define PR_ALIGN_OF_INT64 8 andre@0: #define PR_ALIGN_OF_FLOAT 4 andre@0: #define PR_ALIGN_OF_WORD 4 andre@0: #define PR_ALIGN_OF_DWORD 8 andre@0: #define PR_ALIGN_OF_DOUBLE 4 andre@0: #define PR_ALIGN_OF_POINTER 4 andre@0: andre@0: #define PR_BYTES_PER_WORD_LOG2 2 andre@0: #define PR_BYTES_PER_DWORD_LOG2 3 andre@0: andre@0: #elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_) andre@0: andre@0: #define IS_LITTLE_ENDIAN 1 andre@0: #undef IS_BIG_ENDIAN andre@0: #define IS_64 andre@0: andre@0: #define PR_BYTES_PER_BYTE 1 andre@0: #define PR_BYTES_PER_SHORT 2 andre@0: #define PR_BYTES_PER_INT 4 andre@0: #define PR_BYTES_PER_INT64 8 andre@0: #define PR_BYTES_PER_LONG 4 andre@0: #define PR_BYTES_PER_FLOAT 4 andre@0: #define PR_BYTES_PER_WORD 8 andre@0: #define PR_BYTES_PER_DWORD 8 andre@0: #define PR_BYTES_PER_DOUBLE 8 andre@0: andre@0: #define PR_BITS_PER_BYTE 8 andre@0: #define PR_BITS_PER_SHORT 16 andre@0: #define PR_BITS_PER_INT 32 andre@0: #define PR_BITS_PER_INT64 64 andre@0: #define PR_BITS_PER_LONG 32 andre@0: #define PR_BITS_PER_FLOAT 32 andre@0: #define PR_BITS_PER_WORD 64 andre@0: #define PR_BITS_PER_DWORD 64 andre@0: #define PR_BITS_PER_DOUBLE 64 andre@0: andre@0: #define PR_BITS_PER_BYTE_LOG2 3 andre@0: #define PR_BITS_PER_SHORT_LOG2 4 andre@0: #define PR_BITS_PER_INT_LOG2 5 andre@0: #define PR_BITS_PER_INT64_LOG2 6 andre@0: #define PR_BITS_PER_LONG_LOG2 5 andre@0: #define PR_BITS_PER_FLOAT_LOG2 5 andre@0: #define PR_BITS_PER_WORD_LOG2 6 andre@0: #define PR_BITS_PER_DWORD_LOG2 6 andre@0: #define PR_BITS_PER_DOUBLE_LOG2 6 andre@0: andre@0: #define PR_ALIGN_OF_SHORT 2 andre@0: #define PR_ALIGN_OF_INT 4 andre@0: #define PR_ALIGN_OF_LONG 4 andre@0: #define PR_ALIGN_OF_INT64 8 andre@0: #define PR_ALIGN_OF_FLOAT 4 andre@0: #define PR_ALIGN_OF_WORD 8 andre@0: #define PR_ALIGN_OF_DWORD 8 andre@0: #define PR_ALIGN_OF_DOUBLE 8 andre@0: #define PR_ALIGN_OF_POINTER 8 andre@0: andre@0: #define PR_BYTES_PER_WORD_LOG2 3 andre@0: #define PR_BYTES_PER_DWORD_LOG2 3 andre@0: andre@0: #elif defined(_M_IA64) || defined(_IA64_) andre@0: andre@0: #define IS_LITTLE_ENDIAN 1 andre@0: #undef IS_BIG_ENDIAN andre@0: #define IS_64 andre@0: andre@0: #define PR_BYTES_PER_BYTE 1 andre@0: #define PR_BYTES_PER_SHORT 2 andre@0: #define PR_BYTES_PER_INT 4 andre@0: #define PR_BYTES_PER_INT64 8 andre@0: #define PR_BYTES_PER_LONG 4 andre@0: #define PR_BYTES_PER_FLOAT 4 andre@0: #define PR_BYTES_PER_WORD 8 andre@0: #define PR_BYTES_PER_DWORD 8 andre@0: #define PR_BYTES_PER_DOUBLE 8 andre@0: andre@0: #define PR_BITS_PER_BYTE 8 andre@0: #define PR_BITS_PER_SHORT 16 andre@0: #define PR_BITS_PER_INT 32 andre@0: #define PR_BITS_PER_INT64 64 andre@0: #define PR_BITS_PER_LONG 32 andre@0: #define PR_BITS_PER_FLOAT 32 andre@0: #define PR_BITS_PER_WORD 64 andre@0: #define PR_BITS_PER_DWORD 64 andre@0: #define PR_BITS_PER_DOUBLE 64 andre@0: andre@0: #define PR_BITS_PER_BYTE_LOG2 3 andre@0: #define PR_BITS_PER_SHORT_LOG2 4 andre@0: #define PR_BITS_PER_INT_LOG2 5 andre@0: #define PR_BITS_PER_INT64_LOG2 6 andre@0: #define PR_BITS_PER_LONG_LOG2 5 andre@0: #define PR_BITS_PER_FLOAT_LOG2 5 andre@0: #define PR_BITS_PER_WORD_LOG2 6 andre@0: #define PR_BITS_PER_DWORD_LOG2 6 andre@0: #define PR_BITS_PER_DOUBLE_LOG2 6 andre@0: andre@0: #define PR_ALIGN_OF_SHORT 2 andre@0: #define PR_ALIGN_OF_INT 4 andre@0: #define PR_ALIGN_OF_LONG 4 andre@0: #define PR_ALIGN_OF_INT64 8 andre@0: #define PR_ALIGN_OF_FLOAT 4 andre@0: #define PR_ALIGN_OF_WORD 8 andre@0: #define PR_ALIGN_OF_DWORD 8 andre@0: #define PR_ALIGN_OF_DOUBLE 8 andre@0: #define PR_ALIGN_OF_POINTER 8 andre@0: andre@0: #define PR_BYTES_PER_WORD_LOG2 3 andre@0: #define PR_BYTES_PER_DWORD_LOG2 3 andre@0: andre@0: #elif defined(_M_ARM) || defined(_ARM_) andre@0: andre@0: #define IS_LITTLE_ENDIAN 1 andre@0: #undef IS_BIG_ENDIAN andre@0: andre@0: #define PR_BYTES_PER_BYTE 1 andre@0: #define PR_BYTES_PER_SHORT 2 andre@0: #define PR_BYTES_PER_INT 4 andre@0: #define PR_BYTES_PER_INT64 8 andre@0: #define PR_BYTES_PER_LONG 4 andre@0: #define PR_BYTES_PER_FLOAT 4 andre@0: #define PR_BYTES_PER_WORD 4 andre@0: #define PR_BYTES_PER_DWORD 8 andre@0: #define PR_BYTES_PER_DOUBLE 8 andre@0: andre@0: #define PR_BITS_PER_BYTE 8 andre@0: #define PR_BITS_PER_SHORT 16 andre@0: #define PR_BITS_PER_INT 32 andre@0: #define PR_BITS_PER_INT64 64 andre@0: #define PR_BITS_PER_LONG 32 andre@0: #define PR_BITS_PER_FLOAT 32 andre@0: #define PR_BITS_PER_WORD 32 andre@0: #define PR_BITS_PER_DWORD 64 andre@0: #define PR_BITS_PER_DOUBLE 64 andre@0: andre@0: #define PR_BITS_PER_BYTE_LOG2 3 andre@0: #define PR_BITS_PER_SHORT_LOG2 4 andre@0: #define PR_BITS_PER_INT_LOG2 5 andre@0: #define PR_BITS_PER_INT64_LOG2 6 andre@0: #define PR_BITS_PER_LONG_LOG2 5 andre@0: #define PR_BITS_PER_FLOAT_LOG2 5 andre@0: #define PR_BITS_PER_WORD_LOG2 5 andre@0: #define PR_BITS_PER_DWORD_LOG2 6 andre@0: #define PR_BITS_PER_DOUBLE_LOG2 6 andre@0: andre@0: #define PR_ALIGN_OF_SHORT 2 andre@0: #define PR_ALIGN_OF_INT 4 andre@0: #define PR_ALIGN_OF_LONG 4 andre@0: #define PR_ALIGN_OF_INT64 8 andre@0: #define PR_ALIGN_OF_FLOAT 4 andre@0: #define PR_ALIGN_OF_WORD 4 andre@0: #define PR_ALIGN_OF_DWORD 8 andre@0: #define PR_ALIGN_OF_DOUBLE 8 andre@0: #define PR_ALIGN_OF_POINTER 4 andre@0: andre@0: #define PR_BYTES_PER_WORD_LOG2 2 andre@0: #define PR_BYTES_PER_DWORD_LOG2 3 andre@0: andre@0: #else /* defined(_M_IX86) || defined(_X86_) */ andre@0: andre@0: #error unknown processor architecture andre@0: andre@0: #endif /* defined(_M_IX86) || defined(_X86_) */ andre@0: andre@0: #ifndef HAVE_LONG_LONG andre@0: #define HAVE_LONG_LONG andre@0: #endif andre@0: andre@0: #ifndef NO_NSPR_10_SUPPORT andre@0: andre@0: #define BYTES_PER_BYTE PR_BYTES_PER_BYTE andre@0: #define BYTES_PER_SHORT PR_BYTES_PER_SHORT andre@0: #define BYTES_PER_INT PR_BYTES_PER_INT andre@0: #define BYTES_PER_INT64 PR_BYTES_PER_INT64 andre@0: #define BYTES_PER_LONG PR_BYTES_PER_LONG andre@0: #define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT andre@0: #define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE andre@0: #define BYTES_PER_WORD PR_BYTES_PER_WORD andre@0: #define BYTES_PER_DWORD PR_BYTES_PER_DWORD andre@0: andre@0: #define BITS_PER_BYTE PR_BITS_PER_BYTE andre@0: #define BITS_PER_SHORT PR_BITS_PER_SHORT andre@0: #define BITS_PER_INT PR_BITS_PER_INT andre@0: #define BITS_PER_INT64 PR_BITS_PER_INT64 andre@0: #define BITS_PER_LONG PR_BITS_PER_LONG andre@0: #define BITS_PER_FLOAT PR_BITS_PER_FLOAT andre@0: #define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE andre@0: #define BITS_PER_WORD PR_BITS_PER_WORD andre@0: andre@0: #define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 andre@0: #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 andre@0: #define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 andre@0: #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 andre@0: #define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 andre@0: #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 andre@0: #define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 andre@0: #define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 andre@0: andre@0: #define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT andre@0: #define ALIGN_OF_INT PR_ALIGN_OF_INT andre@0: #define ALIGN_OF_LONG PR_ALIGN_OF_LONG andre@0: #define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 andre@0: #define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT andre@0: #define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE andre@0: #define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER andre@0: #define ALIGN_OF_WORD PR_ALIGN_OF_WORD andre@0: andre@0: #define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 andre@0: #define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 andre@0: #define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 andre@0: andre@0: #endif /* NO_NSPR_10_SUPPORT */ andre@0: andre@0: #endif /* nspr_cpucfg___ */