/* Convert an integer into a floating point variable */
{
Float D;
- D.V = Val;
+ D.V = (float) Val;
return D;
}
unsigned char* FP_D_Data (Double Val)
/* Return the raw data of a double in a malloc'ed buffer. Free after use. */
{
- float F = Val.V;
+ float F = (float) Val.V;
return memcpy (xmalloc (F_SIZE), &F, F_SIZE);
}
/* If we have stdint.h, include it, otherwise try some quesswork on types.
- * gcc doesn't define __STDC_VERSION__ without special flags, so check for
- * gcc explicitly. Undefined symbols are replaced by zero, so a check for
- * defined(__GNUC__) is not necessary.
+ * gcc and msvc don't define __STDC_VERSION__ without special flags, so check
+ * for them explicitly. Undefined symbols are replaced by zero, so a check for
+ * defined(__GNUC__) or defined(_MSC_VER) is not necessary.
*/
-#if (__STDC_VERSION__ >= 199901) || (__GNUC__ >= 3)
+#if (__STDC_VERSION__ >= 199901) || (__GNUC__ >= 3) || (_MSC_VER >= 1600)
#include <stdint.h>
#else
#define va_copy(dest,src) __va_copy(dest, src)
#endif
+/* MS VC allows for assignment */
+#if defined(_MSC_VER)
+#define va_copy(dest,src) ((dest) = (src))
+#endif
+
/* If va_copy is not defined now, we have a problem */
#if !defined(va_copy)
#error "Need a working va_copy!"