~ubuntu-branches/ubuntu/lucid/warzone2100/lucid

« back to all changes in this revision

Viewing changes to lib/framework/wzglobal.h

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger, Paul Wise, Christoph Egger
  • Date: 2009-06-29 17:12:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090629171252-5ddnlfg3zfchrega
Tags: 2.2.1+dfsg1-1
[ Paul Wise ]
* New upstream release (Closes: #534962)
* Adjust the flex build-depends to take account of the conflict
  with all the versions of flex 2.5.34 (LP: #372872)
* Make the -music Recommends more strict, 2.1 music doesn't work
  with 2.2.
* Upstream moved the downloads to sourceforge, update the watch file
* Bump Standards-Version, no changes needed
* Drop use of dh_desktop since it no longer does anything
* Recommend the new warzone2100-video package, version 2.2 or similar
* Mention the warzone2100 crash reports in the -dbg package description

[ Christoph Egger ]
* Replace CC-2.0 graphic from cybersphinx, create a new tarball
* Add myself to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
        This file is part of Warzone 2100.
3
3
        Copyright (C) 1992-2007  Trolltech ASA.
4
 
        Copyright (C) 2005-2007  Warzone Resurrection Project
 
4
        Copyright (C) 2005-2009  Warzone Resurrection Project
5
5
 
6
6
        Warzone 2100 is free software; you can redistribute it and/or modify
7
7
        it under the terms of the GNU General Public License as published by
277
277
*/
278
278
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
279
279
# define WZ_C99
280
 
#else
281
 
/**
282
 
 * Implements the interface of the C99 macro va_copy such that we can use it on
283
 
 * non-C99 systems as well.
284
 
 *
285
 
 * This implementation assumes that va_list is just a pointer to the stack
286
 
 * frame of the variadic function. This is by far the most common setup, though
287
 
 * it might not always work.
288
 
 */
289
 
# define va_copy(dest, src) (void)((dest) = (src))
290
280
#endif /* WZ_Cxx */
291
281
 
 
282
/*
 
283
   The supported C++ standard, must be one of: (WZ_CXXxx)
 
284
 
 
285
     98       - ISO/IEC 14882:1998 / C++98
 
286
*/
 
287
#if defined(__cplusplus)
 
288
# define WZ_CXX98
 
289
#endif /* WZ_CXXxx */
 
290
 
292
291
 
293
292
/*
294
293
   Convenience macros to test the versions of gcc.
450
449
#if defined(WZ_CC_GNU) || defined(WZ_CC_INTEL)
451
450
#  define WZ_DECL_THREAD __thread
452
451
#elif defined(WZ_CC_MSVC)
453
 
#  define __declspec(thread)
 
452
#  define WZ_DECL_THREAD __declspec(thread)
454
453
#else
455
454
#  error "Thread local storage attribute required"
456
455
#endif
459
458
/*! \def WZ_ASSERT_STATIC_STRING
460
459
 * Asserts that two types are equal
461
460
 */
462
 
#if defined(WZ_CC_GNU) || defined(WZ_CC_INTEL)
 
461
#if defined(__cplusplus)
 
462
#  include <typeinfo>
 
463
#  define WZ_ASSERT_STATIC_STRING(_var) assert(typeid(_var) == typeid(char[]))
 
464
#elif defined(WZ_CC_GNU) || defined(WZ_CC_INTEL)
463
465
#  define WZ_ASSERT_STATIC_STRING(_var) assert(__builtin_types_compatible_p(typeof(_var), char[]))
464
466
#else
465
 
#  define WZ_ASSERT_STATIC_STRING(_var) (void)_var
 
467
#  define WZ_ASSERT_STATIC_STRING(_var) (void)(_var)
466
468
#endif
467
469
 
468
470
 
469
 
/* ---- Global constants ---- */
470
 
 
471
 
#define MAX_STR_LENGTH          256
472
 
 
473
471
/* ---- Platform specific setup ---- */
474
472
 
475
473
 
497
495
 
498
496
#  if defined(WZ_CC_MSVC)
499
497
//   notify people we are disabling these warning messages.
500
 
#    pragma message (" *** Warnings 4100,4127,4204 & 4244 have been squelched. ***")
 
498
#    pragma message (" *** Warnings 4018,4100,4127,4204,4244,4267,4389 have been squelched. ***")
 
499
#    pragma warning (disable : 4018) // Shut up: '>' : signed/unsigned mismatch
501
500
#    pragma warning (disable : 4100) // Shut up: unreferenced formal parameter (FIXME)
502
501
#    pragma warning (disable : 4127) // Shut up: conditional expression is constant (eg. "while(0)")
503
502
#    pragma warning (disable : 4204) // Shut up: non-constant aggregate initializer
504
503
#    pragma warning (disable : 4244) // Shut up: conversion from 'float' to 'int', possible loss of data
 
504
#    pragma warning (disable : 4267) // Shut up: conversion from 'size_t' to 'type', possible loss of data
 
505
#    pragma warning (disable : 4389) // Shut up: '==' : signed/unsigned mismatch
505
506
 
506
507
#    define strcasecmp _stricmp
507
508
#    define strncasecmp _strnicmp
508
509
#    define inline __inline
509
510
#    define alloca _alloca
510
511
#    define fileno _fileno
 
512
 
 
513
#    define isnan _isnan
511
514
#    define isfinite _finite
 
515
 
512
516
#    define PATH_MAX MAX_PATH
513
517
#  endif /* WZ_CC_MSVC */
514
518
 
526
530
#endif /* WZ_OS_* */
527
531
 
528
532
 
 
533
#if !defined(WZ_C99) && !defined(va_copy)
 
534
/**
 
535
 * Implements the interface of the C99 macro va_copy such that we can use it on
 
536
 * non-C99 systems as well.
 
537
 *
 
538
 * This implementation assumes that va_list is just a pointer to the stack
 
539
 * frame of the variadic function. This is by far the most common setup, though
 
540
 * it might not always work.
 
541
 */
 
542
# define va_copy(dest, src) (void)((dest) = (src))
 
543
#endif // !WZ_C99 && !va_copy
 
544
 
 
545
 
529
546
#endif /* WZGLOBAL_H */