source: gsdl/trunk/trunk/mgpp/lib/longlong.h@ 16583

Last change on this file since 16583 was 16583, checked in by davidb, 16 years ago

Undoing change commited in r16582

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1/**************************************************************************
2 *
3 * longlong.h -- Use of GCC's long long integer types
4 * Copyright (C) 1999 Tim A.H. Bell
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *
20 **************************************************************************/
21
22#ifndef H_LONGLONG
23#define H_LONGLONG
24
25#ifdef HAVE_CONFIG_H
26# ifdef __WIN32__
27# include <win32cfg.h>
28# else
29# include <config.h>
30# endif
31#endif
32
33/*
34 Use GCC's "long long" integer types for certain variables, to avoid
35 overflowing 32 bit integers.
36
37 Other files affected:
38
39 lib:
40 bitio_random.c
41 bitio_random.h
42
43 src/text:
44 ivf.pass1.c
45 ivf.pass2.c
46 build.h
47 mg_passes.c
48 text.h
49
50*/
51
52/*#define TESTING_OVERFLOW*/
53
54#ifdef TESTING_OVERFLOW
55
56/* Test the overflow detection by using tiny (16-bit) types */
57typedef unsigned short int mg_ullong;
58typedef short int mg_llong;
59
60#define ULL_FS "u"
61#define LL_FS "d"
62
63#elif defined __GNUC__ && ! defined DISABLE_LONG_LONG
64
65/* We're using GCC, so it's okay to use "long long" (64-bit) types */
66#define USE_LONG_LONG
67
68typedef unsigned long long int mg_ullong;
69typedef long long int mg_llong;
70
71#define ULL_FS "llu"
72#define LL_FS "lld"
73
74#else
75
76/* Not using GCC, so fall back on plain "long" (32-bit) types */
77typedef unsigned long int mg_ullong;
78typedef long int mg_llong;
79
80#define ULL_FS "lu"
81#define LL_FS "ld"
82
83#endif /* __GNUC__ */
84
85#endif
Note: See TracBrowser for help on using the repository browser.