author | Mario de Sousa <msousa@fe.up.pt> |
Thu, 19 Jul 2012 11:05:41 +0100 | |
changeset 610 | 50b708dff319 |
parent 607 | be9ba3531afb |
child 645 | e01ede1c9862 |
permissions | -rw-r--r-- |
597
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
1 |
/* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
2 |
* matiec - a compiler for the programming languages defined in IEC 61131-3 |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
3 |
* Copyright (C) 2003-2011 Mario de Sousa (msousa@fe.up.pt) |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
4 |
* Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
5 |
* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
6 |
* This program is free software: you can redistribute it and/or modify |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
7 |
* it under the terms of the GNU General Public License as published by |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
8 |
* the Free Software Foundation, either version 3 of the License, or |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
9 |
* (at your option) any later version. |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
10 |
* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
11 |
* This program is distributed in the hope that it will be useful, |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
14 |
* GNU General Public License for more details. |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
15 |
* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
18 |
* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
19 |
* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
20 |
* This code is made available on the understanding that it will not be |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
21 |
* used in safety-critical situations without a full and competent review. |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
22 |
*/ |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
23 |
|
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
24 |
/* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
25 |
* An IEC 61131-3 compiler. |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
26 |
* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
27 |
* Based on the |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
28 |
* FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
29 |
* |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
30 |
*/ |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
31 |
|
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
32 |
|
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
33 |
|
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
34 |
#ifndef _MAIN_HH |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
35 |
#define _MAIN_HH |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
36 |
|
604
2989051a0a64
Fixing includes to define INTxx_MAX etc...
Mario de Sousa <msousa@fe.up.pt>
parents:
597
diff
changeset
|
37 |
|
2989051a0a64
Fixing includes to define INTxx_MAX etc...
Mario de Sousa <msousa@fe.up.pt>
parents:
597
diff
changeset
|
38 |
|
597
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
39 |
/* Function used throughout the code --> used to report failed assertions (i.e. internal compiler errors)! */ |
604
2989051a0a64
Fixing includes to define INTxx_MAX etc...
Mario de Sousa <msousa@fe.up.pt>
parents:
597
diff
changeset
|
40 |
#include <stddef.h> /* required for NULL */ |
2989051a0a64
Fixing includes to define INTxx_MAX etc...
Mario de Sousa <msousa@fe.up.pt>
parents:
597
diff
changeset
|
41 |
|
597
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
42 |
#define ERROR error_exit(__FILE__,__LINE__) |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
43 |
#define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg) |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
44 |
// #define ERROR_MSG(msg, ...) error_exit(__FILE__,__LINE__, msg, __VA_ARGS__) |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
45 |
|
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
46 |
extern void error_exit(const char *file_name, int line_no, const char *errmsg = NULL, ...); |
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
47 |
|
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
48 |
|
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
49 |
|
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
50 |
|
607
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
51 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
52 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
53 |
/* Get the definition of INT16_MAX, INT16_MIN, UINT64_MAX, INT64_MAX, INT64_MIN, ... */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
54 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
55 |
#define __STDC_LIMIT_MACROS /* required to have UINTxx_MAX defined when including stdint.h from C++ source code. */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
56 |
#include <stdint.h> |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
57 |
#include <limits> |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
58 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
59 |
#ifndef UINT64_MAX |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
60 |
#define UINT64_MAX (std::numeric_limits< uint64_t >::max()) |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
61 |
#endif |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
62 |
#ifndef INT64_MAX |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
63 |
#define INT64_MAX (std::numeric_limits< int64_t >::max()) |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
64 |
#endif |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
65 |
#ifndef INT64_MIN |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
66 |
#define INT64_MIN (std::numeric_limits< int64_t >::min()) |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
67 |
#endif |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
68 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
69 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
70 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
71 |
/* Determine, for the current platform, which datas types (float, double or long double) use 64 and 32 bits. */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
72 |
/* NOTE: We cant use sizeof() in pre-processor directives, so we have to do it another way... */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
73 |
/* CURIOSITY: We can use sizeof() and offsetof() inside static_assert() but: |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
74 |
* - this only allows us to make assertions, and not #define new macros |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
75 |
* - is only available in the C standard [ISO/IEC 9899:2011] and the C++ 0X draft standard [Becker 2008]. It is not available in C99. |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
76 |
* https://www.securecoding.cert.org/confluence/display/seccode/DCL03-C.+Use+a+static+assertion+to+test+the+value+of+a+constant+expression |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
77 |
* struct {int a, b, c, d} header_t; |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
78 |
* e.g.: static_assert(offsetof(struct header_t, c) == 8, "Compile time error message."); |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
79 |
*/ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
80 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
81 |
#include <float.h> |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
82 |
#if (LDBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
83 |
#define long_double long double |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
84 |
#define real64_t long_double /* so we can later use #if (real64_t == long_double) directives in the code! */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
85 |
#define REAL64_MAX LDBL_MAX |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
86 |
#elif ( DBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
87 |
#define real64_t double |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
88 |
#define REAL64_MAX DBL_MAX |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
89 |
#elif ( FLT_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
90 |
#define real64_t float |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
91 |
#define REAL64_MAX FLT_MAX |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
92 |
#else |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
93 |
#error Could not find a 64 bit floating point data type on this platform. Aborting... |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
94 |
#endif |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
95 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
96 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
97 |
#if (LDBL_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
98 |
#ifndef long_double |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
99 |
#define long_double long double |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
100 |
#endif |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
101 |
#define real32_t long_double /* so we can later use #if (real32_t == long_double) directives in the code! */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
102 |
#define REAL32_MAX LDBL_MAX |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
103 |
#elif ( DBL_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
104 |
#define real32_t double |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
105 |
#define REAL32_MAX DBL_MAX |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
106 |
#elif ( FLT_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */ |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
107 |
#define real32_t float |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
108 |
#define REAL32_MAX FLT_MAX |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
109 |
#else |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
110 |
#error Could not find a 32 bit floating point data type on this platform. Aborting... |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
111 |
#endif |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
112 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
113 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
114 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
115 |
#include <math.h> |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
116 |
#ifndef INFINITY |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
117 |
#error Could not find the macro that defines the value for INFINITY in the current platform. |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
118 |
#endif |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
119 |
#ifndef NAN |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
120 |
#error Could not find the macro that defines the value for NAN in the current platform. |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
121 |
#endif |
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
122 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
123 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
124 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
125 |
|
be9ba3531afb
cleaning up code. Changing HUGE_VAL to INFINITY.
Mario de Sousa <msousa@fe.up.pt>
parents:
604
diff
changeset
|
126 |
|
597
7326a0658104
Add file missing from previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
127 |
#endif // #ifndef _MAIN_HH |