~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to modules/linux/vmblock/include/vm_basic_types.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-03-20 10:19:00 UTC
  • mfrom: (1.1.4 upstream) (2.4.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090320101900-1o604camiubq2de8
Tags: 2009.03.18-154848-2
Correcting patch system depends (Closes: #520493).

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
#endif
84
84
 
85
85
#ifdef _MSC_VER
86
 
typedef unsigned __int64 uint64;
87
 
typedef signed __int64 int64;
88
86
 
89
87
#pragma warning (3 :4505) // unreferenced local function
90
88
#pragma warning (disable :4018) // signed/unsigned mismatch
95
93
#pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned
96
94
#pragma warning (disable :4142) // benign redefinition of type
97
95
 
 
96
#endif
 
97
 
 
98
#if defined(__APPLE__) || defined(HAVE_STDINT_H)
 
99
 
 
100
/*
 
101
 * TODO: This is a C99 standard header.  We should be able to test for
 
102
 * #if __STDC_VERSION__ >= 199901L, but that breaks the Netware build
 
103
 * (which doesn't have stdint.h).
 
104
 */
 
105
 
 
106
#include <stdint.h>
 
107
 
 
108
typedef uint64_t uint64;
 
109
typedef int64_t int64;
 
110
typedef uint32_t uint32;
 
111
typedef int32_t int32;
 
112
typedef uint16_t uint16;
 
113
typedef int16_t int16;
 
114
typedef uint8_t uint8;
 
115
 
 
116
/*
 
117
 * XXX: int8_t is defined to be 'signed char' on Mac hosts.
 
118
 *
 
119
 * Unfortunately, GCC 4.0.1 warns when doing pointer assignment or
 
120
 * comparison between signed char * and char * (even if char is
 
121
 * signed).
 
122
 *
 
123
 * If we want to use int8_t to define int8, we need to go through and
 
124
 * replace uses of char * with signed char * to prevent warnings.
 
125
 */
 
126
typedef char int8;
 
127
 
 
128
#else /* !HAVE_STDINT_H */
 
129
 
 
130
#ifdef _MSC_VER
 
131
 
 
132
typedef unsigned __int64 uint64;
 
133
typedef signed __int64 int64;
 
134
 
98
135
#elif __GNUC__
99
136
/* The Xserver source compiles with -ansi -pendantic */
100
137
#ifndef __STRICT_ANSI__
111
148
#endif
112
149
#else
113
150
#error - Need compiler define for int64/uint64
114
 
#endif
 
151
#endif /* _MSC_VER */
115
152
 
116
153
typedef unsigned int       uint32;
117
154
typedef unsigned short     uint16;
121
158
typedef short     int16;
122
159
typedef char      int8;
123
160
 
 
161
#endif /* HAVE_STDINT_H */
 
162
 
124
163
/*
125
164
 * FreeBSD (for the tools build) unconditionally defines these in
126
165
 * sys/inttypes.h so don't redefine them if this file has already
143
182
#ifdef HAVE_SYS_INTTYPES_H
144
183
#include <sys/inttypes.h>
145
184
#endif
146
 
#ifdef HAVE_STDINT_H
147
 
#include <stdint.h>
148
 
#endif
149
185
#ifdef HAVE_STDLIB_H
150
186
#include <stdlib.h>
151
187
#endif
231
267
      #define FMTPD      "I"
232
268
      #define FMTH       "I"
233
269
   #endif
 
270
#elif defined __APPLE__
 
271
   /* Mac OS hosts use the same formatters for 32- and 64-bit. */
 
272
   #define FMT64 "ll"
 
273
   #define FMTSZ "z"
 
274
   #define FMTPD "l"
 
275
   #define FMTH ""
234
276
#elif __GNUC__
235
277
   #define FMTH ""
236
278
   #if defined(N_PLAT_NLM) || defined(sun) || \
252
294
      || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \
253
295
      || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
254
296
      || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L)
255
 
      /* BSD/Darwin, Linux */
 
297
      /* BSD, Linux */
256
298
      #define FMTSZ     "z"
257
299
 
258
 
      #if defined(VM_X86_64) || defined(__APPLE__)
 
300
      #if defined(VM_X86_64)
259
301
         #define FMTPD  "l"
260
302
      #else
261
303
         #define FMTPD  ""
271
313
   #endif
272
314
   #ifdef VM_X86_64
273
315
      #define FMT64     "l"
274
 
   #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__)
 
316
   #elif defined(sun) || defined(__FreeBSD__)
275
317
      #define FMT64     "ll"
276
318
   #else
277
319
      #define FMT64     "L"
296
338
#ifdef _MSC_VER
297
339
#define CONST64(c) c##I64
298
340
#define CONST64U(c) c##uI64
 
341
#elif defined __APPLE__
 
342
#define CONST64(c) c##LL
 
343
#define CONST64U(c) c##uLL
299
344
#elif __GNUC__
300
345
#ifdef VM_X86_64
301
346
#define CONST64(c) c##L
447
492
 */
448
493
typedef VA32 UserVA32;
449
494
typedef VA64 UserVA64;
450
 
typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */
 
495
typedef UserVA64 UserVAConst; /* Userspace ptr to data that we may only read. */
 
496
typedef UserVA32 UserVA32Const; /* Userspace ptr to data that we may only read. */
451
497
typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */
452
498
#ifdef VMKERNEL
453
 
typedef UserVA32 UserVA;
 
499
typedef UserVA64 UserVA;
454
500
#else
455
501
typedef void * UserVA;
456
502
#endif
837
883
#endif
838
884
 
839
885
/*
840
 
 * Format modifier for printing uid_t.  On sun the uid_t is a ulong, but on
841
 
 * Linux it's an int.
 
886
 * Format modifier for printing uid_t.  On Solaris 10 and earlier, uid_t
 
887
 * is a ulong, but on other platforms it's an unsigned int.
842
888
 * Use this like this: printf("The uid is %"FMTUID".\n", uid);
843
889
 */
844
 
#ifdef sun
 
890
#if defined(sun) && !defined(SOL11)
845
891
#   ifdef VM_X86_64
846
892
#      define FMTUID "u"
847
893
#   else