forked from github/server
use cmake for autoconf, slim down platform.h
This commit is contained in:
parent
fc1a56d46a
commit
1a7d892a96
|
@ -6,17 +6,42 @@ enable_testing()
|
|||
INCLUDE (CheckIncludeFiles)
|
||||
INCLUDE (CheckSymbolExists)
|
||||
CHECK_INCLUDE_FILES (stdbool.h HAVE_STDBOOL_H)
|
||||
CHECK_SYMBOL_EXISTS (_Bool "stdbool.h" HAVE__BOOL)
|
||||
CHECK_INCLUDE_FILES (windows.h HAVE_WINDOWS_H)
|
||||
CHECK_INCLUDE_FILES (strings.h HAVE_STRINGS_H)
|
||||
CHECK_SYMBOL_EXISTS (strdup "string.h" HAVE_STRDUP)
|
||||
CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H)
|
||||
IF (HAVE_WINDOWS_H)
|
||||
CHECK_SYMBOL_EXISTS (_sleep "windows.h" HAVE__SLEEP)
|
||||
ENDIF(HAVE_WINDOWS_H)
|
||||
IF(HAVE_STDBOOL_H)
|
||||
CHECK_SYMBOL_EXISTS (_Bool "stdbool.h" HAVE__BOOL)
|
||||
ENDIF(HAVE_STDBOOL_H)
|
||||
IF(HAVE_UNISTD_H)
|
||||
CHECK_SYMBOL_EXISTS (sleep "unistd.h" HAVE_SLEEP)
|
||||
CHECK_SYMBOL_EXISTS (usleep "unistd.h" HAVE_USLEEP)
|
||||
ENDIF(HAVE_UNISTD_H)
|
||||
CHECK_SYMBOL_EXISTS (strcasecmp "string.h" HAVE_STRCASECMP)
|
||||
CHECK_SYMBOL_EXISTS (strncasecmp "string.h" HAVE_STRNCASECMP)
|
||||
CHECK_SYMBOL_EXISTS (_strlwr "string.h" HAVE__STRLWR)
|
||||
CHECK_SYMBOL_EXISTS (_strcmpl "string.h" HAVE__STRCMPL)
|
||||
CHECK_SYMBOL_EXISTS (_strdup "string.h" HAVE__STRDUP)
|
||||
CHECK_SYMBOL_EXISTS (mkdir "sys/stat.h" HAVE_MKDIR)
|
||||
CHECK_SYMBOL_EXISTS (_mkdir "direct.h" HAVE__MKDIR)
|
||||
CHECK_SYMBOL_EXISTS (_stricmp "string.h" HAVE__STRICMP)
|
||||
CHECK_SYMBOL_EXISTS (_memicmp "string.h" HAVE__MEMICMP)
|
||||
CHECK_SYMBOL_EXISTS (strcmpl "string.h" HAVE_STRCMPL)
|
||||
CHECK_SYMBOL_EXISTS (strdup "string.h" HAVE_STRDUP)
|
||||
CHECK_SYMBOL_EXISTS (stricmp "string.h" HAVE_STRICMP)
|
||||
CHECK_SYMBOL_EXISTS (memicmp "string.h" HAVE_MEMICMP)
|
||||
CHECK_SYMBOL_EXISTS (strlwr "string.h" HAVE_STRLWR)
|
||||
CHECK_SYMBOL_EXISTS (snprintf "stdio.h" HAVE_SNPRINTF)
|
||||
CHECK_SYMBOL_EXISTS (_snprintf "stdio.h" HAVE__SNPRINTF)
|
||||
CHECK_SYMBOL_EXISTS (mkdir "sys/stat.h" HAVE_SYS_STAT_MKDIR)
|
||||
CHECK_SYMBOL_EXISTS (mkdir "direct.h" HAVE_DIRECT_MKDIR)
|
||||
CHECK_SYMBOL_EXISTS (_mkdir "direct.h" HAVE_DIRECT__MKDIR)
|
||||
|
||||
CONFIGURE_FILE (
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
|
||||
${CMAKE_BINARY_DIR}/include/config.h)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/autoconf.h.in
|
||||
${CMAKE_BINARY_DIR}/include/autoconf.h)
|
||||
INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/include)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_AUTOCONF")
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DHAVE__BOOL")
|
||||
|
|
|
@ -0,0 +1,115 @@
|
|||
#pragma once
|
||||
#ifndef CMAKE_AUTOCONF_H
|
||||
#define CMAKE_AUTOCONF_H
|
||||
#cmakedefine HAVE_STDBOOL_H 1
|
||||
#cmakedefine HAVE_STRINGS_H 1
|
||||
#cmakedefine HAVE_WINDOWS_H 1
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
#cmakedefine HAVE__BOOL 1
|
||||
#cmakedefine HAVE_STRCASECMP 1
|
||||
#cmakedefine HAVE_STRNCASECMP 1
|
||||
#cmakedefine HAVE__STRICMP 1
|
||||
#cmakedefine HAVE_SNPRINTF 1
|
||||
#cmakedefine HAVE__SNPRINTF 1
|
||||
#cmakedefine HAVE_SLEEP 1
|
||||
#cmakedefine HAVE_USLEEP 1
|
||||
#cmakedefine HAVE__SLEEP 1
|
||||
#cmakedefine HAVE_STRDUP 1
|
||||
#cmakedefine HAVE__STRDUP 1
|
||||
#cmakedefine HAVE_STRICMP 1
|
||||
#cmakedefine HAVE__STRCMPL 1
|
||||
#cmakedefine HAVE_STRCMPL 1
|
||||
#cmakedefine HAVE__MEMICMP 1
|
||||
#cmakedefine HAVE_MEMICMP 1
|
||||
#cmakedefine HAVE__STRLWR 1
|
||||
#cmakedefine HAVE_STRLWR 1
|
||||
#cmakedefine HAVE_SYS_STAT_MKDIR 1
|
||||
#cmakedefine HAVE_DIRECT_MKDIR 1
|
||||
#cmakedefine HAVE_DIRECT__MKDIR 1
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#if defined(HAVE_STRINGS_H)
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE__MEMICMP)
|
||||
#if defined(HAVE_MEMICMP)
|
||||
#define _memicmp(a, b, n) memicmp(a, b, n)
|
||||
#elif defined(HAVE_STRNCASECMP)
|
||||
#define _memicmp(a, b, n) strncasecmp(a, b, n)
|
||||
#else
|
||||
#define _memicmp(a, b, n) lcp_memicmp(a, b, n)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE__STRCMPL)
|
||||
#if defined(HAVE_STRCMPL)
|
||||
#define _strcmpl(a, b) strcmpl(a, b)
|
||||
#elif defined(HAVE__STRICMP)
|
||||
#define _strcmpl(a, b) _stricmp(a, b)
|
||||
#elif defined(HAVE_STRICMP)
|
||||
#define _strcmpl(a, b) stricmp(a, b)
|
||||
#elif defined(HAVE_STRCASECMP)
|
||||
#define _strcmpl(a, b) strcasecmp(a, b)
|
||||
#else
|
||||
#define _strcmpl(a, b) lcp_strcmpl(a, b)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DIRECT__MKDIR)
|
||||
#include <direct.h>
|
||||
#elif defined(HAVE_DIRECT_MKDIR)
|
||||
#include <direct.h>
|
||||
#define _mkdir(a) mkdir(a)
|
||||
#elif defined(HAVE_SYS_STAT_MKDIR)
|
||||
#include <sys/stat.h>
|
||||
#define _mkdir(a) mkdir(a, 0777)
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE__STRLWR)
|
||||
#if defined(HAVE_STRLWR)
|
||||
#define _strlwr(a) strlwr(a)
|
||||
#else
|
||||
#define _strlwr(a) lcp_strlwr(a)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE__STRDUP)
|
||||
#if defined(HAVE_STRDUP)
|
||||
#define _strdup(a) strdup(a)
|
||||
#else
|
||||
#define _strdup(a) lcp_strdup(a)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE__SLEEP)
|
||||
#if defined(HAVE_USLEEP)
|
||||
#define _sleep(a) usleep(a)
|
||||
#elif defined(HAVE_SLEEP)
|
||||
#define _sleep(a) sleep((a)/1000)
|
||||
#else
|
||||
#define _sleep(a) lcp_sleep(a)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE__SNPRINTF)
|
||||
#if defined(HAVE_SNPRINTF)
|
||||
#define _snprintf snprintf
|
||||
#else
|
||||
#define _snprintf lcp_snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#if !defined(DBG_UNREFERENCED_PARAMETER)
|
||||
#define DBG_UNREFERENCED_PARAMETER(x) x
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,7 +0,0 @@
|
|||
#cmakedefine HAVE_STDBOOL_H 1
|
||||
#cmakedefine HAVE__BOOL 1
|
||||
#cmakedefine HAVE_STRINGS_H 1
|
||||
#cmakedefine HAVE_STRDUP 1
|
||||
#cmakedefine HAVE__STRDUP 1
|
||||
#cmakedefine HAVE_MKDIR 1
|
||||
#cmakedefine HAVE__MKDIR 1
|
|
@ -21,6 +21,6 @@ echo "Building with $CC and $JOBS jobs"
|
|||
|
||||
mkdir -p $BIN_DIR
|
||||
cd $BIN_DIR
|
||||
CC="$CC" cmake .. -DCMAKE_MODULE_PATH=$PWD/../cmake/Modules -DCMAKE_BUILD_TYPE=Debug
|
||||
CC="$CC" ../s/cmake-init
|
||||
make -j$JOBS
|
||||
make test
|
||||
|
|
|
@ -37,6 +37,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
/* stdc includes */
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
typedef struct object_data {
|
||||
|
|
|
@ -25,6 +25,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
attrib_type at_raceprefix = {
|
||||
"raceprefix", NULL, a_finalizestring, NULL, a_writestring, a_readstring,
|
||||
|
|
|
@ -22,6 +22,8 @@ without prior permission by the authors of Eressea.
|
|||
#include <util/language.h>
|
||||
|
||||
#include <tolua.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int tolua_buildinglist_next(lua_State * L)
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@ without prior permission by the authors of Eressea.
|
|||
#include <quicklist.h>
|
||||
|
||||
#include <tolua.h>
|
||||
#include <string.h>
|
||||
|
||||
int tolua_factionlist_next(lua_State * L)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@ without prior permission by the authors of Eressea.
|
|||
#include <tolua.h>
|
||||
#include <lua.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
static int tolua_hashtable_get(lua_State * L)
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include <tolua.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define E_OK 0
|
||||
#define E_INVALID_MESSAGE 1
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <quicklist.h>
|
||||
|
||||
#include <tolua.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static int tolua_levitate_ship(lua_State * L)
|
||||
{
|
||||
|
|
|
@ -40,6 +40,8 @@ without prior permission by the authors of Eressea.
|
|||
#include <tolua.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int tolua_regionlist_next(lua_State * L)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,8 @@ without prior permission by the authors of Eressea.
|
|||
#include <util/language.h>
|
||||
|
||||
#include <tolua.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int tolua_shiplist_next(lua_State * L)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,8 @@ without prior permission by the authors of Eressea.
|
|||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <tolua.h>
|
||||
|
||||
|
|
|
@ -55,6 +55,8 @@ without prior permission by the authors of Eressea.
|
|||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
|
||||
static int tolua_unit_get_objects(lua_State * L)
|
||||
|
|
|
@ -76,6 +76,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
/* libs includes */
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
** Lua binding: eressea
|
||||
** Generated automatically by tolua 5.1.3 on Thu Mar 13 14:40:47 2014.
|
||||
** Generated automatically by tolua 5.1.3 on Sat Mar 15 19:26:36 2014.
|
||||
*/
|
||||
|
||||
#include "tolua.h"
|
||||
|
|
|
@ -35,6 +35,7 @@ without prior permission by the authors of Eressea.
|
|||
#include <lua.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
static int
|
||||
lua_giveitem(unit * s, unit * d, const item_type * itype, int n, struct order *ord)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <util/bool.h>
|
||||
#include "platform.h"
|
||||
#include <util/base36.h>
|
||||
#include <platform.h>
|
||||
|
||||
#include "json.h"
|
||||
|
||||
|
@ -11,6 +10,9 @@
|
|||
#include <stream.h>
|
||||
#include "cJSON.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
int json_import(struct stream * out) {
|
||||
|
@ -26,7 +28,7 @@ int json_export(stream * out, unsigned int flags) {
|
|||
for (r = regions; r; r = r->next) {
|
||||
char id[32];
|
||||
cJSON *data;
|
||||
snprintf(id, sizeof(id), "%u", r->uid);
|
||||
_snprintf(id, sizeof(id), "%u", r->uid);
|
||||
cJSON_AddItemToObject(json, id, data = cJSON_CreateObject());
|
||||
cJSON_AddNumberToObject(data, "x", r->x);
|
||||
cJSON_AddNumberToObject(data, "y", r->y);
|
||||
|
|
|
@ -70,6 +70,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#pragma endregion
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "calendar.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int first_turn = 0;
|
||||
int first_month = 0;
|
||||
|
|
|
@ -39,6 +39,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
unsigned int nextborder = 0;
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
/* libc includes */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <assert.h>
|
||||
|
|
|
@ -35,6 +35,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
/* libc includes */
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static equipment *equipment_sets;
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include <CuTest.h>
|
||||
#include <tests.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void test_updatespells(CuTest * tc)
|
||||
{
|
||||
faction * f;
|
||||
|
|
|
@ -67,6 +67,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int *storms;
|
||||
|
|
|
@ -42,6 +42,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <ctype.h>
|
||||
#include <wctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
const char *describe_braineater(unit * u, const struct locale *lang)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <util/goodies.h>
|
||||
#include <util/rng.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
extern int dice_rand(const char *s);
|
||||
|
|
|
@ -1590,7 +1590,7 @@ static seen_region **prepare_report(faction * f)
|
|||
|
||||
int write_reports(faction * f, time_t ltime)
|
||||
{
|
||||
int backup = 1, maxbackup = 128;
|
||||
int backup = 1, maxbackup = 128*1000;
|
||||
bool gotit = false;
|
||||
struct report_context ctx;
|
||||
const char *encoding = "UTF-8";
|
||||
|
@ -1629,9 +1629,9 @@ int write_reports(faction * f, time_t ltime)
|
|||
if (errno) {
|
||||
char zText[64];
|
||||
puts(" ERROR");
|
||||
sprintf(zText, "Waiting %u seconds before retry", backup);
|
||||
sprintf(zText, "Waiting %u seconds before we retry", backup/1000);
|
||||
perror(zText);
|
||||
sleep(backup);
|
||||
_sleep(backup);
|
||||
if (backup < maxbackup) {
|
||||
backup *= 2;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include <CuTest.h>
|
||||
#include <tests.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static void test_reorder_units(CuTest * tc)
|
||||
{
|
||||
region *r;
|
||||
|
|
|
@ -30,6 +30,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
/* libc includes */
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static critbit_tree cb_spells;
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include "spellbook.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
spellbook * create_spellbook(const char * name)
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <CuTest.h>
|
||||
#include <tests.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
int count_spell_cb(spellbook_entry * sbe, void * ptr)
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sqlite3.h>
|
||||
#include <md5.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
faction *get_faction_by_id(int uid)
|
||||
{
|
||||
|
|
|
@ -61,6 +61,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
/* libc includes */
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
/* libc includes */
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -40,6 +40,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
/* libc includes */
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int average_score_of_age(int age, int a)
|
||||
{
|
||||
|
|
189
src/platform.h
189
src/platform.h
|
@ -52,82 +52,34 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
# define _CRT_DISABLE_PERFCRIT_LOCKS
|
||||
#endif
|
||||
|
||||
#endif /* _MSC_VER_ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
# include <cstdio>
|
||||
# include <cstdlib>
|
||||
extern "C" {
|
||||
#else
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/**** ****
|
||||
** Debugging Libraries **
|
||||
**** ****/
|
||||
#if defined __GNUC__
|
||||
# define HAVE_INLINE
|
||||
# define INLINE_FUNCTION static __inline
|
||||
#endif
|
||||
|
||||
/* define USE_DMALLOC to enable use of the dmalloc library */
|
||||
#ifdef USE_DMALLOC
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
/* define CRTDBG to enable MSVC CRT Debug library functions */
|
||||
#if defined(_DEBUG) && defined(_MSC_VER) && defined(CRTDBG)
|
||||
#if defined(_DEBUG) && defined(CRTDBG)
|
||||
# include <crtdbg.h>
|
||||
# define _CRTDBG_MAP_ALLOC
|
||||
#endif
|
||||
|
||||
/**** ****
|
||||
** Architecture Dependent **
|
||||
**** ****/
|
||||
# define HAVE_INLINE
|
||||
# define INLINE_FUNCTION __inline
|
||||
#endif /* _MSC_VER_ */
|
||||
|
||||
/* für solaris: */
|
||||
#ifdef SOLARIS
|
||||
# define _SYS_PROCSET_H
|
||||
# define _XOPEN_SOURCE
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# ifndef _BSD_SOURCE
|
||||
# define _BSD_SOURCE
|
||||
# define __USE_BSD
|
||||
# endif
|
||||
/* # include <features.h> */
|
||||
# include <strings.h> /* strncasecmp-Prototyp */
|
||||
#if defined __GNUC__
|
||||
# define HAVE_INLINE
|
||||
# define INLINE_FUNCTION static __inline
|
||||
# undef _BSD_SOURCE
|
||||
# define _BSD_SOURCE
|
||||
# undef __USE_BSD
|
||||
# define __USE_BSD
|
||||
#endif
|
||||
|
||||
#ifdef _BSD_SOURCE
|
||||
# undef __EXTENSIONS__
|
||||
# define __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
# define HAVE__MKDIR_WITHOUT_PERMISSION
|
||||
# define HAVE__SLEEP_MSEC
|
||||
#endif
|
||||
|
||||
#if defined(__USE_SVID) || defined(_BSD_SOURCE) || defined(__USE_XOPEN_EXTENDED) || defined(_BE_SETUP_H) || defined(CYGWIN)
|
||||
# include <unistd.h>
|
||||
# define HAVE_UNISTD_H
|
||||
# define HAVE_STRCASECMP
|
||||
# define HAVE_STRNCASECMP
|
||||
# define HAVE_ACCESS
|
||||
# define HAVE_STAT
|
||||
typedef struct stat stat_type;
|
||||
# include <string.h>
|
||||
# define HAVE_SNPRINTF
|
||||
#ifdef _POSIX_SOURCE /* MINGW doesn't seem to have these */
|
||||
# define HAVE_EXECINFO
|
||||
# define HAVE_SIGACTION
|
||||
# define HAVE_LINK
|
||||
# define HAVE_SLEEP
|
||||
#endif
|
||||
#ifdef SOLARIS
|
||||
# define _SYS_PROCSET_H
|
||||
#undef _XOPEN_SOURCE
|
||||
# define _XOPEN_SOURCE
|
||||
#endif
|
||||
|
||||
/* TinyCC */
|
||||
|
@ -136,90 +88,6 @@ typedef struct stat stat_type;
|
|||
# define INLINE_FUNCTION
|
||||
#endif
|
||||
|
||||
/* lcc-win32 */
|
||||
#ifdef __LCC__
|
||||
# include <string.h>
|
||||
# include <direct.h>
|
||||
# include <io.h>
|
||||
# define HAVE_ACCESS
|
||||
# define HAVE_STAT
|
||||
typedef struct stat stat_type;
|
||||
# define HAVE_STRICMP
|
||||
# define HAVE_STRNICMP
|
||||
# define HAVE_SLEEP
|
||||
# define snprintf _snprintf
|
||||
# define HAVE_SNPRINTF
|
||||
# undef HAVE_STRCASECMP
|
||||
# undef HAVE_STRNCASECMP
|
||||
# define R_OK 4
|
||||
#endif
|
||||
|
||||
/* Microsoft Visual C */
|
||||
#ifdef _MSC_VER
|
||||
# include <string.h> /* must be included here so strdup is not redefined */
|
||||
# define R_OK 4
|
||||
# define HAVE_INLINE
|
||||
# define INLINE_FUNCTION __inline
|
||||
|
||||
# define snprintf _snprintf
|
||||
# define HAVE_SNPRINTF
|
||||
|
||||
/* MSVC has _access, not access */
|
||||
#ifndef access
|
||||
#include <io.h>
|
||||
# define access(f, m) _access(f, m)
|
||||
#endif
|
||||
#define HAVE_ACCESS
|
||||
|
||||
/* MSVC has _stat, not stat */
|
||||
# define HAVE_STAT
|
||||
#include <sys/stat.h>
|
||||
# define stat(a, b) _stat(a, b)
|
||||
typedef struct _stat stat_type;
|
||||
|
||||
# define stricmp(a, b) _stricmp(a, b)
|
||||
# define HAVE_STRICMP
|
||||
|
||||
# define strnicmp(a, b, c) _strnicmp(a, b, c)
|
||||
# define HAVE_STRNICMP
|
||||
# undef HAVE_STRCASECMP
|
||||
# undef HAVE_STRNCASECMP
|
||||
#endif
|
||||
|
||||
/* replacements for missing functions: */
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# if defined(HAVE_STRICMP)
|
||||
# define strcasecmp stricmp
|
||||
# elif defined(HAVE__STRICMP)
|
||||
# define strcasecmp _stricmp
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# if defined(HAVE_STRNICMP)
|
||||
# define strncasecmp strnicmp
|
||||
# elif defined(HAVE__STRNICMP)
|
||||
# define strncasecmp _strnicmp
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SLEEP
|
||||
#ifdef HAVE__SLEEP_MSEC
|
||||
# define sleep(sec) _sleep(1000*sec)
|
||||
#elif defined(HAVE__SLEEP)
|
||||
# define sleep(sec) _sleep(sec)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(MAX_PATH)
|
||||
# if defined(PATH_MAX)
|
||||
# define MAX_PATH PATH_MAX
|
||||
# else
|
||||
# define MAX_PATH 1024
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/**** ****
|
||||
** min/max macros **
|
||||
**** ****/
|
||||
|
@ -251,19 +119,24 @@ typedef struct _stat stat_type;
|
|||
|
||||
#define TOLUA_CAST (char*)
|
||||
|
||||
#if !defined(HAVE__STRDUP)
|
||||
# if defined(HAVE_STRDUP)
|
||||
# define _strdup(s) strdup(s)
|
||||
# endif
|
||||
#ifdef USE_AUTOCONF
|
||||
# include <autoconf.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE__MKDIR)
|
||||
# include <direct.h>
|
||||
#if !defined(MAX_PATH)
|
||||
#if defined(PATH_MAX)
|
||||
# define MAX_PATH PATH_MAX
|
||||
#else
|
||||
# if defined(HAVE_MKDIR)
|
||||
# include <sys/stat.h>
|
||||
# define _mkdir(s) mkdir(s, 0777)
|
||||
# endif
|
||||
# define MAX_PATH 256
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
** Lua binding: process
|
||||
** Generated automatically by tolua 5.1.3 on Sat Mar 8 10:21:00 2014.
|
||||
** Generated automatically by tolua 5.1.3 on Sat Mar 15 19:26:36 2014.
|
||||
*/
|
||||
|
||||
#include "tolua.h"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "platform.h"
|
||||
#include <platform.h>
|
||||
#include <kernel/config.h>
|
||||
#include "races.h"
|
||||
|
||||
|
@ -27,6 +27,9 @@
|
|||
#include <util/functions.h>
|
||||
#include <util/rng.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void age_firedragon(struct unit *u);
|
||||
void age_dragon(struct unit *u);
|
||||
void age_illusion(struct unit *u);
|
||||
|
@ -40,7 +43,7 @@ static void oldfamiliars(unit * u)
|
|||
char fname[64];
|
||||
/* these familiars have no special skills.
|
||||
*/
|
||||
snprintf(fname, sizeof(fname), "%s_familiar", u_race(u)->_name[0]);
|
||||
_snprintf(fname, sizeof(fname), "%s_familiar", u_race(u)->_name[0]);
|
||||
create_mage(u, M_GRAY);
|
||||
equip_unit(u, get_equipment(fname));
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
** Lua binding: settings
|
||||
** Generated automatically by tolua 5.1.3 on Sat Mar 8 10:21:00 2014.
|
||||
** Generated automatically by tolua 5.1.3 on Sat Mar 15 19:26:36 2014.
|
||||
*/
|
||||
|
||||
#include "tolua.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <storage.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct wallcurse {
|
||||
curse *buddy;
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
/* libc includes */
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define EFFECT_HEALING_SPELL 5
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <util/lists.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#undef SUMMARY_BOM /* write a BOM in the summary file */
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include <util/log.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct race *test_create_race(const char *name)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include <config.h>
|
||||
#if HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#else
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <platform.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
*/
|
||||
#ifndef UTIL_FILEREADER_H
|
||||
#define UTIL_FILEREADER_H
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include <util/log.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "log.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <wctype.h>
|
||||
#include <memory.h>
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static FILE *sqlstream = NULL;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "unicode.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <wctype.h>
|
||||
|
||||
#define B00000000 0x00
|
||||
|
|
2
storage
2
storage
|
@ -1 +1 @@
|
|||
Subproject commit 38495edd9c2dfa544ab3b9b29e9ea254e57e06e1
|
||||
Subproject commit eabc730c24e67a9f21ea7c32c558075582275d61
|
Loading…
Reference in New Issue