forked from github/server
continue fixing compilation (gcc/clang)
This commit is contained in:
parent
d94cde67a4
commit
5ddd511aa8
|
@ -34,6 +34,7 @@ without prior permission by the authors of Eressea.
|
|||
|
||||
#include <tolua.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct helpmode {
|
||||
const char *name;
|
||||
|
|
|
@ -18,6 +18,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#ifndef H_KRNL_ALLIANCE
|
||||
#define H_KRNL_ALLIANCE
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "keyword.h"
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#define H_KEYWORD_H
|
||||
|
||||
#include "kernel/types.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#ifndef UNILIB_H
|
||||
#define UNILIB_H
|
||||
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
|
||||
#ifndef MAX_PATH
|
||||
# define MAX_PATH 4096
|
||||
#endif
|
||||
|
@ -12,4 +14,5 @@
|
|||
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
#define TOLUA_CAST (char*)
|
||||
#endif
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <util/log.h>
|
||||
#include <util/unicode.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <ctype.h>
|
||||
#include <wctype.h>
|
||||
|
||||
|
@ -30,7 +31,7 @@ static int eatwhite(const char *ptr, size_t * total_size)
|
|||
ret = unicode_utf8_to_ucs4(&ucs, ptr, &size);
|
||||
if (ret != 0)
|
||||
break;
|
||||
if (!iswxspace((wint_t)ucs))
|
||||
if (!iswspace((wint_t)ucs))
|
||||
break;
|
||||
*total_size += size;
|
||||
ptr += size;
|
||||
|
@ -52,7 +53,7 @@ static const char *getbuf_latin1(FILE * F)
|
|||
|
||||
if (bp == NULL)
|
||||
return NULL;
|
||||
while (*bp && isxspace(*(unsigned char *)bp))
|
||||
while (*bp && isspace(*(unsigned char *)bp))
|
||||
++bp; /* eatwhite */
|
||||
|
||||
comment = (bool)(comment && cont);
|
||||
|
@ -113,15 +114,15 @@ static const char *getbuf_latin1(FILE * F)
|
|||
|
||||
if (iscntrl(c)) {
|
||||
if (!comment && cp < fbuf + MAXLINE) {
|
||||
*cp++ = isxspace(c) ? ' ' : '?';
|
||||
*cp++ = isspace(c) ? ' ' : '?';
|
||||
}
|
||||
++bp;
|
||||
continue;
|
||||
}
|
||||
else if (isxspace(c)) {
|
||||
else if (isspace(c)) {
|
||||
if (!quote) {
|
||||
++bp;
|
||||
while (*bp && isxspace(*(unsigned char *)bp))
|
||||
while (*bp && isspace(*(unsigned char *)bp))
|
||||
++bp; /* eatwhite */
|
||||
if (!comment && *bp && *bp != COMMENT_CHAR && cp < fbuf + MAXLINE)
|
||||
*(cp++) = ' ';
|
||||
|
@ -136,7 +137,7 @@ static const char *getbuf_latin1(FILE * F)
|
|||
}
|
||||
else if (c == CONTINUE_CHAR) {
|
||||
const char *end = ++bp;
|
||||
while (*end && isxspace(*(unsigned char *)end))
|
||||
while (*end && isspace(*(unsigned char *)end))
|
||||
++end; /* eatwhite */
|
||||
if (*end == '\0') {
|
||||
bp = end;
|
||||
|
@ -269,7 +270,7 @@ static const char *getbuf_utf8(FILE * F)
|
|||
break;
|
||||
}
|
||||
|
||||
if (iswxspace((wint_t)ucs)) {
|
||||
if (iswspace((wint_t)ucs)) {
|
||||
if (!quote) {
|
||||
bp += size;
|
||||
ret = eatwhite(bp, &size);
|
||||
|
|
|
@ -32,7 +32,7 @@ static int eatwhitespace_c(const char **str_p)
|
|||
for (;;) {
|
||||
unsigned char utf8_character = (unsigned char)*str;
|
||||
if (~utf8_character & 0x80) {
|
||||
if (!iswxspace(utf8_character))
|
||||
if (!iswspace(utf8_character))
|
||||
break;
|
||||
++str;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ static int eatwhitespace_c(const char **str_p)
|
|||
log_warning("illegal character sequence in UTF8 string: %s\n", str);
|
||||
break;
|
||||
}
|
||||
if (!iswxspace((wint_t)ucs))
|
||||
if (!iswspace((wint_t)ucs))
|
||||
break;
|
||||
str += len;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ void skip_token(void)
|
|||
log_warning("illegal character sequence in UTF8 string: %s\n", states->current_token);
|
||||
}
|
||||
}
|
||||
if (iswxspace((wint_t)ucs) && quotechar == 0) {
|
||||
if (iswspace((wint_t)ucs) && quotechar == 0) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
@ -163,7 +163,7 @@ char *parse_token(const char **str, char *lbuf, size_t buflen)
|
|||
copy = true;
|
||||
escape = false;
|
||||
}
|
||||
else if (iswxspace((wint_t)ucs)) {
|
||||
else if (iswspace((wint_t)ucs)) {
|
||||
if (quotechar == 0)
|
||||
break;
|
||||
copy = true;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#define UTIL_PARSER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#define PASSWORD_PLAINTEXT 0
|
||||
#define PASSWORD_DEFAULT PASSWORD_PLAINTEXT
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#pragma once
|
||||
/*
|
||||
Copyright (c) 1998-2015, Enno Rehling <enno@eressea.de>
|
||||
Katja Zedel <katze@felidae.kn-bremen.de
|
||||
|
@ -18,6 +19,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
|
||||
#ifndef RAND_H
|
||||
#define RAND_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
/* libc includes */
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue