~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to modules/linux/vmmemctl/vm_assert.h

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2008-08-15 21:21:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080815212140-05fhxj8wroosysmj
Tags: 2008.08.08-109361-1ubuntu1
* Merge from Debian unstable (LP: #258393), remaining Ubuntu change:
  - add ubuntu_toolchain_FTBFS.dpatch patch, fix FTBFS
* Update ubuntu_toolchain_FTBFS.dpatch patch for the new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
 
242
242
 
243
243
/*
244
 
 * Compile-time assertions
 
244
 * Compile-time assertions.
 
245
 *
 
246
 * ASSERT_ON_COMPILE does not use the common
 
247
 * switch (0) { case 0: case (e): ; } trick because some compilers (e.g. MSVC)
 
248
 * generate code for it.
 
249
 *
 
250
 * The implementation uses both enum and typedef because the typedef alone is
 
251
 * insufficient; gcc allows arrays to be declared with non-constant expressions
 
252
 * (even in typedefs, where it makes no sense).
245
253
 */
246
254
 
247
255
#define ASSERT_ON_COMPILE(e) \
248
256
   do { \
249
 
      typedef char AssertOnCompileType[(e) ? 1 : -1]; \
 
257
      enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \
 
258
      typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \
250
259
   } while (0)
251
260
 
252
261