Skip to content
Snippets Groups Projects
Commit f7bf43b3 authored by Gregory Maxwell's avatar Gregory Maxwell
Browse files

Some fixes for C89 builds.

parent bd628ab6
No related branches found
No related tags found
No related merge requests found
......@@ -12,8 +12,10 @@ CFLAGS += -DUSE_ALLOCA
# These options affect performance
# HAVE_LRINTF: Use C99 intrinsics to speed up float-to-int conversion
# restrict: Don't use the 'restrict' optimization (for pre-C99 compilers)
# inline: Don't use the 'inline' keyword (for ANSI C compilers)
# restrict: Don't use the 'restrict' keyword (for pre-C99 compilers)
#CFLAGS += -DHAVE_LRINTF
#CFLAGS += -Dinline=
CFLAGS += -Drestrict=
###################### END OF OPTIONS ######################
......
......@@ -115,10 +115,11 @@
#else
#ifdef __GNUC__ /* supported by gcc, but not by all other compilers*/
#if (defined(__GNUC__) && defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L)
/* supported by gcc in C99 mode, but not by all other compilers */
#warning "Don't have the functions lrint() and lrintf ()."
#warning "Replacing these functions with a standard C cast."
#endif /* __GNUC__ */
#endif /* __STDC_VERSION__ >= 199901L */
#include <math.h>
#define float2int(flt) ((int)(floor(.5+flt)))
#endif
......
......@@ -65,6 +65,7 @@ void print_usage( char* argv[] )
#ifdef _WIN32
# define STR_CASEINSENSITIVE_COMPARE(x, y) _stricmp(x, y)
#else
# include <strings.h>
# define STR_CASEINSENSITIVE_COMPARE(x, y) strcasecmp(x, y)
#endif
......
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