Avoid redefinition of _XOPEN_SOURCE
This commit is contained in:
parent
bb1e2c5ded
commit
869684e757
2 changed files with 9 additions and 6 deletions
|
|
@ -23,6 +23,12 @@
|
|||
#ifndef WCWIDTH_COMPAT_H
|
||||
#define WCWIDTH_COMPAT_H
|
||||
|
||||
#include <pyconfig.h>
|
||||
|
||||
#if !defined(_WIN32) && !defined(_XOPEN_SOURCE)
|
||||
#define _XOPEN_SOURCE
|
||||
#endif
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
#if defined(USE_MK_WCWIDTH)
|
||||
|
|
|
|||
9
setup.py
9
setup.py
|
|
@ -5,15 +5,12 @@ from setuptools import setup, Extension
|
|||
|
||||
|
||||
extension_sources = ["cwcwidth/_impl.pyx"]
|
||||
define_macros = []
|
||||
if platform.system() == "Windows":
|
||||
extension_sources.append("cwcwidth/wcwidth.c")
|
||||
define_macros = [
|
||||
define_macrosa.append(
|
||||
("USE_MK_WCWIDTH", None),
|
||||
]
|
||||
else:
|
||||
define_macros = [
|
||||
("_XOPEN_SOURCE", "600"),
|
||||
]
|
||||
)
|
||||
|
||||
ext_modules = [
|
||||
Extension(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue