fix _POSIX_C_SOURCE define in that one place that needs it

This commit is contained in:
Andrei Alexeyev 2018-06-20 23:18:50 +03:00
parent 954bdbec6d
commit 45fc47b1b1
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
2 changed files with 7 additions and 6 deletions

View file

@ -9,12 +9,12 @@ header = r"""\1/*
* Copyright (c) 2011-2018, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
*/
\2\3
\2\4\3
#include "taisei.h"
"""
header_regex = re.compile(r'^(#if 0.*?\s#endif\s*)?(?:\s*?/\*.*?\*/)?(?:\s*?(\n#pragma once))?(?:\s*?#include "taisei.h")?(?:\s*?(\n#pragma once))?\s*', re.MULTILINE | re.DOTALL)
header_regex = re.compile(r'^(#if 0.*?\s#endif\s*)?(?:\s*?/\*.*?\*/)?(?:\s*?(\n#pragma once))?(?:\s*?(\n// begin before-taisei-h\s*.*?\n.*?// end before-taisei-h\n?))?(?:\s*?#include "taisei.h")?(?:\s*?(\n#pragma once))?\s*', re.MULTILINE | re.DOTALL)
if __name__ == '__main__':
for path in itertools.chain(*((pathlib.Path(__file__).parent.parent / 'src').glob(p) for p in ('**/*.[ch]', '**/*.[ch].in'))):

View file

@ -6,11 +6,12 @@
* Copyright (c) 2012-2018, Andrei Alexeyev <akari@alienslab.net>.
*/
#include "taisei.h"
// begin before-taisei-h
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
// end before-taisei-h
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 2
#endif
#include "taisei.h"
#include "rwops_pipe.h"
#include "util.h"