Planeshift

breakpad_types.h

Go to the documentation of this file.
00001 /* Copyright (c) 2006, Google Inc.
00002  * All rights reserved.
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions are
00006  * met:
00007  *
00008  *     * Redistributions of source code must retain the above copyright
00009  * notice, this list of conditions and the following disclaimer.
00010  *     * Redistributions in binary form must reproduce the above
00011  * copyright notice, this list of conditions and the following disclaimer
00012  * in the documentation and/or other materials provided with the
00013  * distribution.
00014  *     * Neither the name of Google Inc. nor the names of its
00015  * contributors may be used to endorse or promote products derived from
00016  * this software without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00019  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00020  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00021  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00022  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00023  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00024  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00025  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00026  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00027  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00028  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
00029 
00030 /* breakpad_types.h: Precise-width types
00031  *
00032  * (This is C99 source, please don't corrupt it with C++.)
00033  *
00034  * This file ensures that types uintN_t are defined for N = 8, 16, 32, and
00035  * 64.  Types of precise widths are crucial to the task of writing data
00036  * structures on one platform and reading them on another.
00037  *
00038  * Author: Mark Mentovai */
00039 
00040 #ifndef GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
00041 #define GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
00042 
00043 #ifndef _WIN32
00044 
00045 #ifndef __STDC_FORMAT_MACROS
00046 #define __STDC_FORMAT_MACROS
00047 #endif  /* __STDC_FORMAT_MACROS */
00048 #include <inttypes.h>
00049 
00050 #else  /* !_WIN32 */
00051 
00052 #if _MSC_VER >= 1600
00053 #include <stdint.h>
00054 #elif defined(BREAKPAD_CUSTOM_STDINT_H)
00055 /* Visual C++ Pre-2010 did not ship a stdint.h, so allow
00056  * consumers of this library to provide their own because
00057  * there are often subtle type incompatibilities.
00058  */
00059 #include BREAKPAD_CUSTOM_STDINT_H
00060 #else
00061 #include <WTypes.h>
00062 
00063 typedef unsigned __int8  uint8_t;
00064 typedef unsigned __int16 uint16_t;
00065 typedef __int32 int32_t;
00066 typedef unsigned __int32 uint32_t;
00067 typedef unsigned __int64 uint64_t;
00068 #endif
00069 
00070 #endif  /* !_WIN32 */
00071 
00072 typedef struct {
00073   uint64_t high;
00074   uint64_t low;
00075 } uint128_struct;
00076 
00077 typedef uint64_t breakpad_time_t;
00078 
00079 /* Try to get PRIx64 from inttypes.h, but if it's not defined, fall back to
00080  * llx, which is the format string for "long long" - this is a 64-bit
00081  * integral type on many systems. */
00082 #ifndef PRIx64
00083 #define PRIx64 "llx"
00084 #endif  /* !PRIx64 */
00085 
00086 #endif  /* GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ */