|
|
Experimental Physics and
| ||||||||||||||
|
|
declares 'isnan' and 'isinf' as external functions but C99 demands that they are macros and newlib-1.15 defines them as such. Including RTEMS' epicsMath.h from a C++ or C99 source file causes a compilation error. The attached kludge fixes this. In fact, using 'isnan/isinf' from code that claims to be ANSI compliant (EPICS base is usually compiled (gcc) with -ansi) is wrong. ANSI-C code should not assume these functions to be present. -- Till *** src/libCom/osi/os/RTEMS/epicsMath.h.orig 2007-09-18 12:38:39.000000000 -0700
--- src/libCom/osi/os/RTEMS/epicsMath.h 2007-09-18 12:46:28.000000000 -0700
***************
*** 16,24 ****
extern "C" {
#endif
int isnan(double);
- int finite(double);
int isinf(double);
#ifdef __cplusplus
}
--- 16,29 ----
extern "C" {
#endif
+ /* T.S.; C99 demands that these are macros and newlib-1.15 defines
+ * them as such!
+ */
+ #if defined(STRICT_ANSI) && !defined(__cplusplus)
int isnan(double);
int isinf(double);
+ #endif
+ int finite(double);
#ifdef __cplusplus
}
| ||||||||||||||
| ANJ, 10 Nov 2011 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |