parser/expat/lib/expat_external.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
     2    See the file COPYING for copying permission.
     3 */
     5 #ifndef Expat_External_INCLUDED
     6 #define Expat_External_INCLUDED 1
     8 /* External API definitions */
    10 #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
    11 #define XML_USE_MSC_EXTENSIONS 1
    12 #endif
    14 /* Expat tries very hard to make the API boundary very specifically
    15    defined.  There are two macros defined to control this boundary;
    16    each of these can be defined before including this header to
    17    achieve some different behavior, but doing so it not recommended or
    18    tested frequently.
    20    XMLCALL    - The calling convention to use for all calls across the
    21                 "library boundary."  This will default to cdecl, and
    22                 try really hard to tell the compiler that's what we
    23                 want.
    25    XMLIMPORT  - Whatever magic is needed to note that a function is
    26                 to be imported from a dynamically loaded library
    27                 (.dll, .so, or .sl, depending on your platform).
    29    The XMLCALL macro was added in Expat 1.95.7.  The only one which is
    30    expected to be directly useful in client code is XMLCALL.
    32    Note that on at least some Unix versions, the Expat library must be
    33    compiled with the cdecl calling convention as the default since
    34    system headers may assume the cdecl convention.
    35 */
    36 #ifndef XMLCALL
    37 #if defined(XML_USE_MSC_EXTENSIONS)
    38 #define XMLCALL __cdecl
    39 #elif defined(__GNUC__) && defined(__i386)
    40 #define XMLCALL __attribute__((cdecl))
    41 #else
    42 /* For any platform which uses this definition and supports more than
    43    one calling convention, we need to extend this definition to
    44    declare the convention used on that platform, if it's possible to
    45    do so.
    47    If this is the case for your platform, please file a bug report
    48    with information on how to identify your platform via the C
    49    pre-processor and how to specify the same calling convention as the
    50    platform's malloc() implementation.
    51 */
    52 #define XMLCALL
    53 #endif
    54 #endif  /* not defined XMLCALL */
    57 #if !defined(XML_STATIC) && !defined(XMLIMPORT)
    58 #ifndef XML_BUILDING_EXPAT
    59 /* using Expat from an application */
    61 #ifdef XML_USE_MSC_EXTENSIONS
    62 #define XMLIMPORT __declspec(dllimport)
    63 #endif
    65 #endif
    66 #endif  /* not defined XML_STATIC */
    69 /* If we didn't define it above, define it away: */
    70 #ifndef XMLIMPORT
    71 #define XMLIMPORT
    72 #endif
    75 #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
    77 #ifdef __cplusplus
    78 extern "C" {
    79 #endif
    81 #ifdef XML_UNICODE_WCHAR_T
    82 #define XML_UNICODE
    83 #endif
    85 /* BEGIN MOZILLA CHANGE (typedef XML_Char to char16_t) */
    86 #if 0
    88 #ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
    89 #ifdef XML_UNICODE_WCHAR_T
    90 typedef wchar_t XML_Char;
    91 typedef wchar_t XML_LChar;
    92 #else
    93 typedef unsigned short XML_Char;
    94 typedef char XML_LChar;
    95 #endif /* XML_UNICODE_WCHAR_T */
    96 #else                  /* Information is UTF-8 encoded. */
    97 typedef char XML_Char;
    98 typedef char XML_LChar;
    99 #endif /* XML_UNICODE */
   101 #endif
   102 /* END MOZILLA CHANGE */
   104 #ifdef XML_LARGE_SIZE  /* Use large integers for file/stream positions. */
   105 #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
   106 typedef __int64 XML_Index; 
   107 typedef unsigned __int64 XML_Size;
   108 #else
   109 typedef long long XML_Index;
   110 typedef unsigned long long XML_Size;
   111 #endif
   112 #else
   113 typedef long XML_Index;
   114 typedef unsigned long XML_Size;
   115 #endif /* XML_LARGE_SIZE */
   117 #ifdef __cplusplus
   118 }
   119 #endif
   121 #endif /* not Expat_External_INCLUDED */

mercurial