Skip to content

Commit 9e96c2f

Browse files
committed
Add "-std=c99" by default
1 parent dbd6df5 commit 9e96c2f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

setup_posix.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,23 @@ def get_config():
8181
cflags = mysql_config("cflags")
8282

8383
include_dirs = []
84-
extra_compile_args = []
84+
extra_compile_args = ["-std=c99"]
8585

8686
for a in cflags:
8787
if a.startswith("-I"):
8888
include_dirs.append(dequote(a[2:]))
8989
elif a.startswith(("-L", "-l")): # This should be LIBS.
9090
pass
9191
else:
92-
extra_compile_args = [a.replace("%", "%%")]
92+
extra_compile_args.append(a.replace("%", "%%"))
9393

9494
# Copy the arch flags for linking as well
95-
for i in range(len(extra_compile_args)):
96-
if extra_compile_args[i] == "-arch":
95+
try:
96+
i = extra_compile_args.index("-arch")
97+
if "-arch" not in extra_link_args:
9798
extra_link_args += ["-arch", extra_compile_args[i + 1]]
99+
except ValueError:
100+
pass
98101

99102
if static:
100103
# properly handle mysql client libraries that are not called libmysqlclient

0 commit comments

Comments
 (0)