upscheme/c/lltinit.c

50 lines
919 B
C
Raw Normal View History

#include <sys/types.h>
2010-01-06 15:27:04 -05:00
#include <locale.h>
#include <math.h>
#include <stdarg.h>
2019-08-09 16:31:21 -04:00
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
2010-01-06 15:27:04 -05:00
#include "dtypes.h"
#include "timefuncs.h"
#include "ios.h"
#include "random.h"
#include "utf8.h"
double D_PNAN;
double D_NNAN;
double D_PINF;
double D_NINF;
float F_PNAN;
float F_NNAN;
float F_PINF;
float F_NINF;
2010-01-06 15:27:04 -05:00
int locale_is_utf8;
#ifdef __WATCOMC__
static float purkka(const char *s, char **dummy) { return strtod(s, dummy); }
#define strtof purkka
#endif
2010-01-06 15:27:04 -05:00
void llt_init()
{
locale_is_utf8 = u8_is_locale_utf8(setlocale(LC_ALL, ""));
randomize();
ios_init_stdstreams();
D_PNAN = strtod("+NaN", NULL);
D_NNAN = -strtod("+NaN", NULL);
D_PINF = strtod("+Inf", NULL);
D_NINF = strtod("-Inf", NULL);
F_PNAN = strtof("+NaN", NULL);
F_NNAN = -strtof("+NaN", NULL);
F_PINF = strtof("+Inf", NULL);
F_NINF = strtof("-Inf", NULL);
2010-01-06 15:27:04 -05:00
}