~ubuntu-branches/debian/sid/octave3.0/sid

« back to all changes in this revision

Viewing changes to liboctave/oct-types.h

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2007-12-23 16:04:15 UTC
  • Revision ID: james.westby@ubuntu.com-20071223160415-n4gk468dihy22e9v
Tags: upstream-3.0.0
ImportĀ upstreamĀ versionĀ 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
Copyright (C) 2005, 2006, 2007 John W. Eaton
 
4
 
 
5
This file is part of Octave.
 
6
 
 
7
Octave is free software; you can redistribute it and/or modify it
 
8
under the terms of the GNU General Public License as published by the
 
9
Free Software Foundation; either version 3 of the License, or (at your
 
10
option) any later version.
 
11
 
 
12
Octave is distributed in the hope that it will be useful, but WITHOUT
 
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
14
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 
15
for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License
 
18
along with Octave; see the file COPYING.  If not, see
 
19
<http://www.gnu.org/licenses/>.
 
20
 
 
21
*/
 
22
 
 
23
#if !defined (octave_oct_types_h)
 
24
#define octave_oct_types_h 1
 
25
 
 
26
typedef int octave_idx_type;
 
27
 
 
28
#if defined (HAVE_STDINT_H)
 
29
#include <stdint.h>
 
30
#elif defined (HAVE_INTTYPES_H)
 
31
#include <inttypes.h>
 
32
#else
 
33
 
 
34
#if defined (HAVE_LIMITS_H)
 
35
#include <limits.h>
 
36
#endif
 
37
 
 
38
#if CHAR_BIT == 8
 
39
typedef signed char int8_t;
 
40
typedef unsigned char uint8_t;
 
41
#else
 
42
#error "CHAR_BIT is not 8!"
 
43
#endif
 
44
 
 
45
#if SIZEOF_SHORT == 2
 
46
typedef short int16_t;
 
47
typedef unsigned short uint16_t;
 
48
#elif SIZEOF_INT == 2
 
49
typedef long int16_t;
 
50
typedef unsigned long uint16_t;
 
51
#else
 
52
#error "No 2 byte integer type found!"
 
53
#endif
 
54
 
 
55
#if SIZEOF_INT == 4
 
56
typedef int int32_t;
 
57
typedef unsigned int uint32_t;
 
58
#elif SIZEOF_LONG == 4
 
59
typedef long int32_t;
 
60
typedef unsigned long uint32_t;
 
61
#else
 
62
#error "No 4 byte integer type found!"
 
63
#endif
 
64
 
 
65
#if SIZEOF_LONG == 8
 
66
typedef long int64_t;
 
67
typedef unsigned long uint64_t;
 
68
#elif SIZEOF_LONG_LONG == 8
 
69
typedef long long int64_t;
 
70
typedef unsigned long long uint64_t;
 
71
#endif
 
72
 
 
73
#endif
 
74
 
 
75
#endif
 
76
 
 
77
/*
 
78
;;; Local Variables: ***
 
79
;;; mode: C++ ***
 
80
;;; End: ***
 
81
*/