Commit dd15594f authored by scoder's avatar scoder Committed by GitHub

Merge pull request #509 from insertinterestingnamehere/define_macros

Allow passing define macros without specified values as commented directives
parents e95a78ad 1df545ac
......@@ -209,7 +209,9 @@ class DistutilsInfo(object):
if type in (list, transitive_list):
value = parse_list(value)
if key == 'define_macros':
value = [tuple(macro.split('=')) for macro in value]
value = [tuple(macro.split('='))
if '=' in macro else (macro, None)
for macro in value]
self.values[key] = value
elif exn is not None:
for key in distutils_settings:
......
#distutils: define_macros = DEFINE_NO_VALUE, DEFINE_WITH_VALUE=0
cdef extern from "define_macro_helper.h" nogil:
int VAL;
def test():
"""
>>> test()
1
"""
return VAL
#pragma once
#ifdef DEFINE_NO_VALUE
#define VAL (DEFINE_WITH_VALUE + 1)
#else
#define VAL DEFINE_WITH_VALUE
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment