~ubuntu-branches/ubuntu/lucid/kmplayer/lucid

« back to all changes in this revision

Viewing changes to src/moz-sdk/nptypes.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2010-03-05 08:35:53 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20100305083553-dcjpc21lpto3oemy
Tags: 1:0.11.2-1ubuntu1
* Merge from Debian unstable, remaining change:
  - Keep kmplayer-base transitional package for 8.04 upgrades

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 * ***** END LICENSE BLOCK ***** */
38
38
 
39
39
/*
40
 
 * Header file for ensuring that C99 types ([u]int32_t and bool) are
41
 
 * available.
 
40
 * Header file for ensuring that C99 types ([u]int32_t and bool) and
 
41
 * true/false macros are available.
42
42
 */
43
43
 
44
44
#if defined(WIN32) || defined(OS2)
45
45
  /*
46
 
   * Win32 and OS/2 don't know C99, so define [u]int_32 here. The bool
 
46
   * Win32 and OS/2 don't know C99, so define [u]int_16/32 here. The bool
47
47
   * is predefined tho, both in C and C++.
48
48
   */
 
49
  typedef short int16_t;
 
50
  typedef unsigned short uint16_t;
49
51
  typedef int int32_t;
50
52
  typedef unsigned int uint32_t;
51
53
#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX)
57
59
 
58
60
  #ifndef __cplusplus
59
61
    typedef int bool;
 
62
    #define true   1
 
63
    #define false  0
60
64
  #endif
61
65
#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
62
66
  /*
67
71
 
68
72
  /*
69
73
   * BSD/OS ships no header that defines uint32_t, nor bool (for C)
70
 
   * OpenBSD ships no header that defines uint32_t and using its bool macro is
71
 
   * unsafe.
72
74
   */
73
 
  #if defined(bsdi) || defined(OPENBSD)
 
75
  #if defined(bsdi)
74
76
  typedef u_int32_t uint32_t;
75
77
 
76
78
  #if !defined(__cplusplus)
77
79
    typedef int bool;
 
80
    #define true   1
 
81
    #define false  0
78
82
  #endif
79
83
  #else
80
84
  /*
81
 
   * FreeBSD defines uint32_t and bool.
 
85
   * FreeBSD and OpenBSD define uint32_t and bool.
82
86
   */
83
87
    #include <inttypes.h>
84
88
    #include <stdbool.h>
93
97
   */
94
98
  #include <stdint.h>
95
99
 
96
 
  #if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
97
 
    #include <stdbool.h>
98
 
  #else
99
 
    /*
100
 
     * GCC 2.91 can't deal with a typedef for bool, but a #define
101
 
     * works.
102
 
     */
103
 
    #define bool int
 
100
  #ifndef __cplusplus
 
101
    #if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
 
102
      #include <stdbool.h>
 
103
    #else
 
104
      /*
 
105
       * GCC 2.91 can't deal with a typedef for bool, but a #define
 
106
       * works.
 
107
       */
 
108
      #define bool int
 
109
      #define true   1
 
110
      #define false  0
 
111
    #endif
104
112
  #endif
105
113
#endif