Skip to content
Snippets Groups Projects
Commit c2d6d9d6 authored by slevy's avatar slevy
Browse files

Accommodate MINGW32 gcc environment. It appears to:

  - supply strcasecmp
  - not supply HUGE
etc.  So make sure HUGE, M_PI, M_LN10 are defined,
along with a few more libm functions used in kira_parti.cc.
parent 69239c01
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,8 @@ unsigned int htonl(unsigned int v) {
}
#include <math.h>
#include <float.h>
double rint(double v) {
return floor(v + 0.5);
}
......
#ifndef WINJUNK_H
#define WINJUNK_H
#ifdef WIN32
/*
* Assorted functions needed for Windows port.
......@@ -11,29 +13,50 @@
#define WINDOWS_LEAN_AND_MEAN 1 /* ugh */
#include <windows.h>
#include <malloc.h>
#include <math.h>
#include <float.h>
#undef htonl
#undef ntohl
extern unsigned int htonl(unsigned int v);
#define ntohl(x) htonl(x)
extern int strcasecmp(const char *s1, const char *s2);
extern int strncasecmp(const char *s1, const char *s2, int maxlen);
#ifndef __MINGW32__
extern int strcasecmp(const char *s1, const char *s2);
extern int strncasecmp(const char *s1, const char *s2, int maxlen);
#endif
#ifndef HUGE
#define HUGE FLT_MAX
#endif
#ifndef M_LN10
#define M_LN10 2.30258509299404568402
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define finite(x) _finite(x)
extern void srandom(int seed);
extern int random();
extern double rint(double);
#ifndef __cplusplus
#define sqrtf(_) sqrt(_)
#define sinf(_) sin(_)
#define cosf(_) cos(_)
#define tanf(_) tan(_)
#define expf(_) exp(_)
#define log10f(_) log10(_)
#define atan2f(_,__) atan2(_,__)
#define hypotf(_,__) hypot(_,__)
#endif
#include <io.h> /* for access() */
#define R_OK 004 /* No Windows include-file defines this?! */
#ifndef R_OK
# define R_OK 004 /* No Windows include-file defines this?! */
#endif
#endif /*WIN32*/
#endif /*WINJUNK_H*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment