forked from github/server
fixing up what my last commit broke, so it compiles on a regular linux again.
platform.h needs some cleanup.
This commit is contained in:
parent
a112dc908e
commit
478f900b7d
|
@ -504,6 +504,8 @@ static unsigned int messagehash(const struct message *msg)
|
|||
return (unsigned int)var.i;
|
||||
}
|
||||
|
||||
extern int fwritestr(FILE * F, const char *str);
|
||||
|
||||
static void render_messages(FILE * F, faction * f, message_list * msgs)
|
||||
{
|
||||
struct mlist *m = msgs->begin;
|
||||
|
|
|
@ -4668,8 +4668,10 @@ int writepasswd(void)
|
|||
char zText[128];
|
||||
|
||||
sprintf(zText, "%s/passwd", basepath());
|
||||
F = cfopen(zText, "w");
|
||||
if (F) {
|
||||
F = fopen(zText, "w");
|
||||
if (!F) {
|
||||
perror(zText);
|
||||
} else {
|
||||
faction *f;
|
||||
log_info("writing passwords...");
|
||||
|
||||
|
|
|
@ -149,9 +149,11 @@ void report_summary(summary * s, summary * o, bool full)
|
|||
} else {
|
||||
sprintf(zText, "%s/parteien", basepath());
|
||||
}
|
||||
F = cfopen(zText, "w");
|
||||
if (!F)
|
||||
F = fopen(zText, "w");
|
||||
if (!F) {
|
||||
perror(zText);
|
||||
return;
|
||||
}
|
||||
#ifdef SUMMARY_BOM
|
||||
else {
|
||||
const unsigned char utf8_bom[4] = { 0xef, 0xbb, 0xbf, 0 };
|
||||
|
|
|
@ -17,6 +17,7 @@ without prior permission by the authors of Eressea.
|
|||
#include <util/log.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -27,7 +28,7 @@ without prior permission by the authors of Eressea.
|
|||
/** writes a quoted string to the file
|
||||
* no trailing space, since this is used to make the creport.
|
||||
*/
|
||||
static int fwritestr(FILE * F, const char *str)
|
||||
int fwritestr(FILE * F, const char *str)
|
||||
{
|
||||
int nwrite = 0;
|
||||
fputc('\"', F);
|
||||
|
|
|
@ -117,7 +117,6 @@ extern "C" {
|
|||
# define HAVE_STAT
|
||||
typedef struct stat stat_type;
|
||||
# include <string.h>
|
||||
# define HAVE_STRDUP
|
||||
# define HAVE_SNPRINTF
|
||||
#ifdef _POSIX_SOURCE /* MINGW doesn't seem to have these */
|
||||
# define HAVE_EXECINFO
|
||||
|
@ -143,7 +142,6 @@ typedef struct stat stat_type;
|
|||
typedef struct stat stat_type;
|
||||
# define HAVE_STRICMP
|
||||
# define HAVE_STRNICMP
|
||||
# define HAVE_STRDUP
|
||||
# define HAVE_SLEEP
|
||||
# define snprintf _snprintf
|
||||
# define HAVE_SNPRINTF
|
||||
|
@ -175,10 +173,6 @@ typedef struct stat stat_type;
|
|||
# define stat(a, b) _stat(a, b)
|
||||
typedef struct _stat stat_type;
|
||||
|
||||
/* MSVC has _strdup */
|
||||
# define strdup _strdup
|
||||
# define HAVE_STRDUP
|
||||
|
||||
# define stricmp(a, b) _stricmp(a, b)
|
||||
# define HAVE_STRICMP
|
||||
|
||||
|
@ -256,4 +250,17 @@ extern char *strdup(const char *s);
|
|||
#define isxspace(c) (c==160 || isspace(c))
|
||||
|
||||
#define TOLUA_CAST (char*)
|
||||
|
||||
#if !defined(HAVE_STRDUP)
|
||||
# if defined(HAVE__STRDUP)
|
||||
# define strdup(s) _strdup(s)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE__STRDUP)
|
||||
# if defined(HAVE_STRDUP)
|
||||
# define _strdup(s) strdup(s)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue