From 9f8e38593fa3bd938448f642b399f4bdbba8b0f9 Mon Sep 17 00:00:00 2001 From: Rick Bird Date: Tue, 26 Apr 2011 01:26:52 -0400 Subject: [PATCH] Several build system fixes and removed the last surviving member of the RESTRICT define in use. IssueID #240 --- Makefile.in | 2 +- acinclude.m4 | 3 +-- config.h.in | 46 ++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 50 ++++++++++++++++++++++++++++++++++++++++++++------ src/funmath.c | 4 ++-- 5 files changed, 94 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 42a2f32..df21739 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,7 +22,7 @@ SQL_LDFLAGS=@MYSQL_LDFLAGS@ @POSTGRESQL_LDFLAGS@ @SQLITE3_LDFLAGS@ CCFLAGS=@CFLAGS@ -I.. -I../hdrs -I/usr/include/lua5.1 @CPPFLAGS@ @PCRE_CFLAGS@ -Werror LDFLAGS=@LDFLAGS@ -CLIBS=@LIBS@ @PCRE_LIBS@ -llua5.1 -lltdl +CLIBS=@LIBS@ @PCRE_LIBS@ -llua5.1 INSTALL=@INSTALL@ INSTALLDIR=$installdir CP=@CP@ diff --git a/acinclude.m4 b/acinclude.m4 index 8f548e3..eaf088d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,4 +1,4 @@ - +m4_include([m4/ltdl.m4]) # SQL Includes m4_include(m4/lib_mysql.m4) m4_include(m4/sqlite.m4) @@ -14,7 +14,6 @@ m4_include(m4/ax_c_check_flag.m4) m4_include(m4/ax_ld_check_flag.m4) m4_include(m4/ax_check_openssl.m4) -# m4_include(m4/ltdl.m4) # =========================================================================== # http://autoconf-archive.cryp.to/ax_c___attribute__.html diff --git a/config.h.in b/config.h.in index 17528e7..636bfe3 100644 --- a/config.h.in +++ b/config.h.in @@ -1,5 +1,10 @@ /* config.h.in. Generated from configure.ac by autoheader. */ + +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + + /* Don't use translation messages */ #undef DONT_TRANSLATE @@ -469,6 +474,9 @@ /* sys/types.h */ #undef I_SYS_TYPES +/* Name of package being built */ +#undef PACKAGE + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -526,6 +534,10 @@ /* Define if uptime exists */ #undef UPTIME +/* Defined as __cdecl if the compiler can handle tat keyword to specify + C-style argument passing convetions. */ +#undef WIN32_CDECL + /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ @@ -604,3 +616,37 @@ /* Define as `fork' if `vfork' does not work. */ #undef vfork + + +#ifdef _MSC_VER +#define WIN32_CDECL __cdecl +#else +#define WIN32_CDECL +#endif +#ifdef HAVE_INOTIFY_INIT +#define HAVE_INOTIFY +#endif +#if HAVE_STDBOOL_H +# include +#else +# if ! HAVE__BOOL +# ifdef __cplusplus +typedef bool _Bool; +# else +# define _Bool signed char +# endif +# endif +# define bool _Bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +#endif +#ifdef HAVE_SSL +#define HAS_OPENSSL +#endif + +/* Someday work to get rid of these. They're left over from the pre-void days */ +typedef void* Malloc_t; +typedef void Free_t; +#endif /* _CONFIG_H_ */ + diff --git a/configure.ac b/configure.ac index c3e4f76..bf467a9 100644 --- a/configure.ac +++ b/configure.ac @@ -6,9 +6,50 @@ # this is the gnu suggested m4 macro file for lua.. doesn't work so well though -AC_PREREQ([2.61]) -AC_INIT([CobraMUSH], [0.80], [devteam@cobramush.org]) +AC_PREREQ([2.67]) +AC_INIT([CobraMUSH], [0.80], [http://redmine.cobramush.org]) AC_CONFIG_HEADERS(config.h) +# Setup some default stuff we need set in config.h +AC_DEFINE(PACKAGE, ["CobraMUSH"], [Name of package being built]) +AC_DEFINE(WIN32_CDECL, , [Defined as __cdecl if the compiler can handle tat keyword to specify C-style argument passing convetions.]) +AH_TOP([ +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + ]) +AH_BOTTOM([ +#ifdef _MSC_VER +#define WIN32_CDECL __cdecl +#else +#define WIN32_CDECL +#endif +#ifdef HAVE_INOTIFY_INIT +#define HAVE_INOTIFY +#endif +#if HAVE_STDBOOL_H +# include +#else +# if ! HAVE__BOOL +# ifdef __cplusplus +typedef bool _Bool; +# else +# define _Bool signed char +# endif +# endif +# define bool _Bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +#endif +#ifdef HAVE_SSL +#define HAS_OPENSSL +#endif + +/* Someday work to get rid of these. They're left over from the pre-void days */ +typedef void* Malloc_t; +typedef void Free_t; +#endif /* _CONFIG_H_ */ + ]) + AC_CANONICAL_BUILD if test "x$CFLAGS" = "x"; then @@ -27,10 +68,6 @@ AC_CHECK_HEADER([ltdl.h], -# lua -# Need to create lua detection that works.. - - ### Programs AC_PATH_PROG(CAT, cat) @@ -195,6 +232,7 @@ AC_CHECK_SIZEOF([time_t]) AC_CHECK_SIZEOF([void *]) ### Libraries +AC_CHECK_LIB(ltdl, [lt_dlopen]) AC_CHECK_LIB(m, sin) AC_CHECK_LIB(intl, gettext) AC_CHECK_LIB(crypt, crypt) diff --git a/src/funmath.c b/src/funmath.c index 1179aa9..3688c58 100644 --- a/src/funmath.c +++ b/src/funmath.c @@ -43,7 +43,7 @@ static NVAL find_median(NVAL *, int); static NVAL angle_to_rad(NVAL angle, const char *from); static NVAL rad_to_angle(NVAL angle, const char *to); -static double frac(double v, double *restrict n, double *RESTRICT d, +static double frac(double v, double *restrict n, double *restrict d, double error); int format_long(intmax_t n, char *buff, char **bp, int maxlen, int base); @@ -1305,7 +1305,7 @@ FUNCTION(fun_root) * \return -1.0 if (v < MIN || v > MAX || error < 0.0) | (v - n/d) / v | otherwise. */ static double -frac(double v, double *restrict n, double *RESTRICT d, double error) +frac(double v, double *restrict n, double *restrict d, double error) { /* Based on a routine found in netlib (http://www.netlib.org) by -- 2.30.2