Skip to content

Commit

Permalink
Avoid redefinition of _XOPEN_SOURCE
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinas committed Oct 8, 2023
1 parent bb1e2c5 commit 869684e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 6 additions & 0 deletions cwcwidth/wcwidth_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@


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(
Expand Down

0 comments on commit 869684e

Please sign in to comment.