View Single Post
Old 26 July 2014, 12:50   #8
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,512
Sorry, I didn't test that as I have no Windows system available.

Visual C++ never implemented C99 correctly (not even after 15 years?), so I guess that support for "long double" and strtold() is missing?

Vbcc has the same problem, as it only implements a part of C99. You may want to modify tfloat.h, which looks like this:
Code:
/* tfloat.h Floating point type and string conversion function. */
/* (c) 2014 Frank Wille */

#ifdef __VBCC__
typedef double tfloat;
#define strtotfloat(n,e) strtod(n,e)
#else
typedef long double tfloat;
#define strtotfloat(n,e) strtold(n,e)
#endif
For a test you can use the same defines as for vbcc. A final fix might look like this:
Code:
/* tfloat.h Floating point type and string conversion function. */
/* (c) 2014 Frank Wille */

#ifdef __VBCC__
typedef double tfloat;
#define strtotfloat(n,e) strtod(n,e)
#elif defined(__WIN32) && defined(_MSC_VER)
typedef double tfloat;
 #define strtotfloat(n,e) strtod(n,e)
 #else
typedef long double tfloat;
#define strtotfloat(n,e) strtold(n,e)
#endif
But I'm not sure how to correctly identify VC++. Maybe somebody tells me.
phx is offline  
 
Page generated in 0.04595 seconds with 11 queries