Skip to content

Commit

Permalink
py-gmpy2: use c99
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Jul 16, 2024
1 parent b6f1c42 commit 0a85784
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/py-gmpy2/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ python.versions 38 39 310 311 312
if {${name} ne ${subport}} {
depends_lib-append port:gmp port:libmpc port:mpfr

# gmpy2_convert_gmp.c: error: ‘for’ loop initial declaration used outside C99 mode
patchfiles-append patch-c99.diff

post-destroot {
xinstall -m 0644 -W ${worksrcpath} README.rst \
${destroot}${prefix}/share/doc/${subport}
Expand Down
10 changes: 10 additions & 0 deletions python/py-gmpy2/files/patch-c99.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- setup.py 2024-03-24 02:01:15.000000000 +0800
+++ setup.py 2024-07-16 19:44:11.000000000 +0800
@@ -6,6 +6,7 @@

ON_WINDOWS = platform.system() == 'Windows'
_comp_args = ["DSHARED=1"]
+_comp_args.append('std=c99')
sources = ['src/gmpy2.c']
if os.getenv('CIBUILDWHEEL'):
include_dirs = [os.path.join(os.path.dirname(__file__), '.local', 'include')]

0 comments on commit 0a85784

Please sign in to comment.