web_pub/browser_plugin_api/inc/prcpucfg.h
changeset 0 dd21522fd290
child 74 91031d3aab7d
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       
     2 /* 
       
     3  * The contents of this file are subject to the Mozilla Public
       
     4  * License Version 1.1 (the "License"); you may not use this file
       
     5  * except in compliance with the License. You may obtain a copy of
       
     6  * the License at http://www.mozilla.org/MPL/
       
     7  * 
       
     8  * Software distributed under the License is distributed on an "AS
       
     9  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
       
    10  * implied. See the License for the specific language governing
       
    11  * rights and limitations under the License.
       
    12  * 
       
    13  * The Original Code is the Netscape Portable Runtime (NSPR).
       
    14  * 
       
    15  * The Initial Developer of the Original Code is Netscape
       
    16  * Communications Corporation.  Portions created by Netscape are 
       
    17  * Copyright (C) 1998-2000 Netscape Communications Corporation.  All
       
    18  * Rights Reserved.
       
    19  * 
       
    20  * Contributor(s):
       
    21  *    Portions Copyright (c) 2004-2006, Nokia Corporation
       
    22  *
       
    23  * 
       
    24  * Alternatively, the contents of this file may be used under the
       
    25  * terms of the GNU General Public License Version 2 or later (the
       
    26  * "GPL"), in which case the provisions of the GPL are applicable 
       
    27  * instead of those above.  If you wish to allow use of your 
       
    28  * version of this file only under the terms of the GPL and not to
       
    29  * allow others to use your version of this file under the MPL,
       
    30  * indicate your decision by deleting the provisions above and
       
    31  * replace them with the notice and other provisions required by
       
    32  * the GPL.  If you do not delete the provisions above, a recipient
       
    33  * may use your version of this file under either the MPL or the
       
    34  * GPL.
       
    35  */
       
    36 
       
    37 /* NOTES:
       
    38  * Nokia modified this file, by changing certain variables for the purpose of
       
    39  * porting the file to the Symbian platform on May 1st, 2004.
       
    40  */
       
    41 
       
    42 
       
    43 #ifndef nspr_cpucfg___
       
    44 #define nspr_cpucfg___
       
    45 
       
    46 #ifndef XP_PC
       
    47 #define XP_PC
       
    48 #endif
       
    49 
       
    50 #ifndef WIN32
       
    51 #define WIN32
       
    52 #endif
       
    53 
       
    54 #ifndef WIN95
       
    55 #define WIN95
       
    56 #endif
       
    57 
       
    58 #ifdef __SYMBIAN32__
       
    59 # undef XP_WIN
       
    60 # undef XP_MAC
       
    61 # undef XP_MACOSX
       
    62 # undef XP_OS2
       
    63 # undef XP_UNIX
       
    64 # undef MOZ_X11
       
    65 # undef _WINDOWS
       
    66 # undef __INTEL__
       
    67 #endif
       
    68 
       
    69 #define PR_AF_INET6 23  /* same as AF_INET6 */
       
    70 
       
    71 #if defined(_M_IX86) || defined(_X86_) || defined(__SYMBIAN32__)
       
    72 
       
    73 #define IS_LITTLE_ENDIAN 1
       
    74 #undef  IS_BIG_ENDIAN
       
    75 
       
    76 #define PR_BYTES_PER_BYTE   1
       
    77 #define PR_BYTES_PER_SHORT  2
       
    78 #define PR_BYTES_PER_INT    4
       
    79 #define PR_BYTES_PER_INT64  8
       
    80 #define PR_BYTES_PER_LONG   4
       
    81 #define PR_BYTES_PER_FLOAT  4
       
    82 #define PR_BYTES_PER_WORD 4
       
    83 #define PR_BYTES_PER_DWORD  8
       
    84 #define PR_BYTES_PER_DOUBLE 8
       
    85 
       
    86 #define PR_BITS_PER_BYTE    8
       
    87 #define PR_BITS_PER_SHORT   16
       
    88 #define PR_BITS_PER_INT     32
       
    89 #define PR_BITS_PER_INT64   64
       
    90 #define PR_BITS_PER_LONG    32
       
    91 #define PR_BITS_PER_FLOAT   32
       
    92 #define PR_BITS_PER_WORD  32
       
    93 #define PR_BITS_PER_DWORD 64
       
    94 #define PR_BITS_PER_DOUBLE  64
       
    95 
       
    96 #define PR_BITS_PER_BYTE_LOG2   3
       
    97 #define PR_BITS_PER_SHORT_LOG2  4
       
    98 #define PR_BITS_PER_INT_LOG2    5
       
    99 #define PR_BITS_PER_INT64_LOG2  6
       
   100 #define PR_BITS_PER_LONG_LOG2   5
       
   101 #define PR_BITS_PER_FLOAT_LOG2  5
       
   102 #define PR_BITS_PER_WORD_LOG2 5
       
   103 #define PR_BITS_PER_DWORD_LOG2  6
       
   104 #define PR_BITS_PER_DOUBLE_LOG2 6
       
   105 
       
   106 #define PR_ALIGN_OF_SHORT   2
       
   107 #define PR_ALIGN_OF_INT     4
       
   108 #define PR_ALIGN_OF_LONG    4
       
   109 #define PR_ALIGN_OF_INT64   8
       
   110 #define PR_ALIGN_OF_FLOAT   4
       
   111 #define PR_ALIGN_OF_WORD  4
       
   112 #define PR_ALIGN_OF_DWORD 8
       
   113 #define PR_ALIGN_OF_DOUBLE  4
       
   114 #define PR_ALIGN_OF_POINTER 4
       
   115 
       
   116 #define PR_BYTES_PER_WORD_LOG2  2
       
   117 #define PR_BYTES_PER_DWORD_LOG2 2
       
   118 
       
   119 #elif defined(_ALPHA_)
       
   120 
       
   121 #define IS_LITTLE_ENDIAN 1
       
   122 #undef  IS_BIG_ENDIAN
       
   123 
       
   124 #define PR_BYTES_PER_BYTE   1
       
   125 #define PR_BYTES_PER_SHORT  2
       
   126 #define PR_BYTES_PER_INT    4
       
   127 #define PR_BYTES_PER_INT64  8
       
   128 #define PR_BYTES_PER_LONG   4
       
   129 #define PR_BYTES_PER_FLOAT  4
       
   130 #define PR_BYTES_PER_DOUBLE 8
       
   131 #define PR_BYTES_PER_WORD   4
       
   132 #define PR_BYTES_PER_DWORD  8
       
   133 
       
   134 #define PR_BITS_PER_BYTE    8
       
   135 #define PR_BITS_PER_SHORT   16
       
   136 #define PR_BITS_PER_INT     32
       
   137 #define PR_BITS_PER_INT64   64
       
   138 #define PR_BITS_PER_LONG    32
       
   139 #define PR_BITS_PER_FLOAT   32
       
   140 #define PR_BITS_PER_DOUBLE  64
       
   141 #define PR_BITS_PER_WORD    32
       
   142 
       
   143 #define PR_BITS_PER_BYTE_LOG2   3
       
   144 #define PR_BITS_PER_SHORT_LOG2  4
       
   145 #define PR_BITS_PER_INT_LOG2    5
       
   146 #define PR_BITS_PER_INT64_LOG2  6
       
   147 #define PR_BITS_PER_LONG_LOG2   5
       
   148 #define PR_BITS_PER_FLOAT_LOG2  5
       
   149 #define PR_BITS_PER_DOUBLE_LOG2 6
       
   150 #define PR_BITS_PER_WORD_LOG2   5
       
   151 
       
   152 #define PR_BYTES_PER_WORD_LOG2  2
       
   153 #define PR_BYTES_PER_DWORD_LOG2 3
       
   154 
       
   155 #define PR_ALIGN_OF_SHORT   2
       
   156 #define PR_ALIGN_OF_INT     4
       
   157 #define PR_ALIGN_OF_LONG    4
       
   158 #define PR_ALIGN_OF_INT64   8
       
   159 #define PR_ALIGN_OF_FLOAT   4
       
   160 #define PR_ALIGN_OF_DOUBLE  8
       
   161 #define PR_ALIGN_OF_POINTER 4
       
   162 
       
   163 #else /* defined(_M_IX86) || defined(_X86_) */
       
   164 
       
   165 #error unknown processor architecture
       
   166 
       
   167 #endif /* defined(_M_IX86) || defined(_X86_) */
       
   168 
       
   169 #define HAVE_LONG_LONG
       
   170 
       
   171 #ifndef NO_NSPR_10_SUPPORT
       
   172 
       
   173 #define BYTES_PER_BYTE      PR_BYTES_PER_BYTE
       
   174 #define BYTES_PER_SHORT     PR_BYTES_PER_SHORT
       
   175 #define BYTES_PER_INT       PR_BYTES_PER_INT
       
   176 #define BYTES_PER_INT64     PR_BYTES_PER_INT64
       
   177 #define BYTES_PER_LONG      PR_BYTES_PER_LONG
       
   178 #define BYTES_PER_FLOAT     PR_BYTES_PER_FLOAT
       
   179 #define BYTES_PER_DOUBLE    PR_BYTES_PER_DOUBLE
       
   180 #define BYTES_PER_WORD      PR_BYTES_PER_WORD
       
   181 #define BYTES_PER_DWORD     PR_BYTES_PER_DWORD
       
   182 
       
   183 #define BITS_PER_BYTE       PR_BITS_PER_BYTE
       
   184 #define BITS_PER_SHORT      PR_BITS_PER_SHORT
       
   185 #define BITS_PER_INT        PR_BITS_PER_INT
       
   186 #define BITS_PER_INT64      PR_BITS_PER_INT64
       
   187 #define BITS_PER_LONG       PR_BITS_PER_LONG
       
   188 #define BITS_PER_FLOAT      PR_BITS_PER_FLOAT
       
   189 #define BITS_PER_DOUBLE     PR_BITS_PER_DOUBLE
       
   190 #define BITS_PER_WORD       PR_BITS_PER_WORD
       
   191 
       
   192 #define BITS_PER_BYTE_LOG2  PR_BITS_PER_BYTE_LOG2
       
   193 #define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
       
   194 #define BITS_PER_INT_LOG2   PR_BITS_PER_INT_LOG2
       
   195 #define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
       
   196 #define BITS_PER_LONG_LOG2  PR_BITS_PER_LONG_LOG2
       
   197 #define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
       
   198 #define BITS_PER_DOUBLE_LOG2    PR_BITS_PER_DOUBLE_LOG2
       
   199 #define BITS_PER_WORD_LOG2  PR_BITS_PER_WORD_LOG2
       
   200 
       
   201 #define ALIGN_OF_SHORT      PR_ALIGN_OF_SHORT
       
   202 #define ALIGN_OF_INT        PR_ALIGN_OF_INT
       
   203 #define ALIGN_OF_LONG       PR_ALIGN_OF_LONG
       
   204 #define ALIGN_OF_INT64      PR_ALIGN_OF_INT64
       
   205 #define ALIGN_OF_FLOAT      PR_ALIGN_OF_FLOAT
       
   206 #define ALIGN_OF_DOUBLE     PR_ALIGN_OF_DOUBLE
       
   207 #define ALIGN_OF_POINTER    PR_ALIGN_OF_POINTER
       
   208 #define ALIGN_OF_WORD       PR_ALIGN_OF_WORD
       
   209 
       
   210 #define BYTES_PER_WORD_LOG2   PR_BYTES_PER_WORD_LOG2
       
   211 #define BYTES_PER_DWORD_LOG2    PR_BYTES_PER_DWORD_LOG2
       
   212 #define WORDS_PER_DWORD_LOG2    PR_WORDS_PER_DWORD_LOG2
       
   213 
       
   214 #endif /* NO_NSPR_10_SUPPORT */
       
   215 
       
   216 #endif /* nspr_cpucfg___ */