write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdarg.h>
+//#include <stdarg.h>
+#include <msvcrt/stdarg.h> // robd
+#include <msvcrt/crttypes.h> // robd
+
#include <msvcrt/errno.h>
#include <limits.h>
#include <msvcrt/ctype.h>
unsigned long int __strtoul_internal (const char *__nptr, char **__endptr, int __base, int __group);
-
-#ifdef __GNUC__
-#define HAVE_LONGLONG
-#define LONGLONG long long
-#else
-#define LONGLONG long
-#endif
+#include <msvcrt/crttypes.h> // robd
+//#ifdef __GNUC__
+//#define HAVE_LONGLONG
+//#define LONGLONG LONGLONG
+//#else
+//#define LONGLONG long
+//#endif
/* Those are flags in the conversion format. */
# define LONG 0x001 /* l: long or double */
-# define LONGDBL 0x002 /* L: long long or long double */
+# define LONGDBL 0x002 /* L: LONGLONG or long double */
# define SHORT 0x004 /* h: short */
# define SUPPRESS 0x008 /* *: suppress assignment */
# define POINTER 0x010 /* weird %p pointer (`fake hex') */
char *old = wp;
wpmax = UCHAR_MAX > 2 * wpmax ? UCHAR_MAX : 2 * wpmax;
wp = (char *) malloc (wpmax);
- if (old != NULL)
- {
+ if (old != NULL) {
memcpy (wp, old, wpsize);
free(old);
}
/* Integral holding variables. */
union
{
- long long int q;
- unsigned long long int uq;
+ LONGLONG q;
+ ULONGLONG uq;
long int l;
unsigned long int ul;
} num;
break;
case 'q':
case 'L':
- /* double's are long double's, and int's are long long int's. */
+ /* double's are long double's, and int's are LONGLONG int's. */
if (flags & TYPEMOD)
/* Signal illegal format element. */
conv_error ();
if (! number_signed)
{
if (flags & LONGDBL) {
- *ARG (unsigned LONGLONG int *) = num.uq;
+ *ARG (ULONGLONG*) = num.uq;
}
else if (flags & LONG)
- *ARG (unsigned long int *) = num.ul;
+ *ARG (unsigned long int*) = num.ul;
else if (flags & SHORT)
- *ARG (unsigned short int *) = (unsigned short int) num.ul;
+ *ARG (unsigned short int*) = (unsigned short int) num.ul;
else
- *ARG (unsigned int *) = (unsigned int) num.ul;
+ *ARG (unsigned int*) = (unsigned int) num.ul;
}
else
{
if (flags & LONGDBL) {
- *ARG (LONGLONG int *) = num.q;
+ *ARG (LONGLONG*) = num.q;
}
else if (flags & LONG)
*ARG (long int *) = num.l;
static double powten[] =
{
1e1L, 1e2L, 1e4L, 1e8L, 1e16L, 1e32L, 1e64L, 1e128L, 1e256L,
+#ifdef __GNUC__
1e512L, 1e512L*1e512L, 1e2048L, 1e4096L
+#else
+ 1e256L, 1e256L, 1e256L, 1e256L
+#endif
};
long double __strtold_internal (const char *s,char **sret, int __group)