char *rptfmt(char *);
char *rptfmti(char *, unsigned short int);
-#ifndef __FreeBSD__ // strnstr is already defined on FreeBSD
+#if !defined(__FreeBSD__) && !defined(__APPLE__) // strnstr is already defined on FreeBSD / Darwin
char *strnstr(char *, char *, size_t);
#endif
static int gen_vasi_light_map() {
const int env_tex_res = 256;
int half_res = env_tex_res / 2;
- unsigned char env_map[env_tex_res][env_tex_res][4];
+
+ static unsigned char env_map[env_tex_res][env_tex_res][4];
GLuint tex_name;
for ( int i = 0; i < env_tex_res; ++i ) {