From 48f2e10bef4509ef7c1ae7ea0ad7dbda0ad6c485 Mon Sep 17 00:00:00 2001 From: notyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com> Date: Wed, 2 Sep 2020 04:13:21 -0700 Subject: [PATCH] fix m2ctx incompatibility on MacOS (#354) --- .gitignore | 1 + tools/m2ctx.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 49d6418cdc..0ec796976e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Cache files __pycache__/ .pyc +.DS_Store # Text editor remnants .vscode/ diff --git a/tools/m2ctx.py b/tools/m2ctx.py index 279209c709..7a35c0434c 100755 --- a/tools/m2ctx.py +++ b/tools/m2ctx.py @@ -25,7 +25,7 @@ def get_c_file(directory): def import_c_file(in_file): in_file = os.path.relpath(in_file, root_dir) - cpp_command = ["cpp", "-P", "-Iinclude", "-Isrc", "-undef", "-D__sgi", "-D_LANGUAGE_C", + cpp_command = ["gcc", "-E", "-P", "-Iinclude", "-Isrc", "-undef", "-D__sgi", "-D_LANGUAGE_C", "-DNON_MATCHING", "-D_Static_assert(x, y)=", "-D__attribute__(x)=", in_file] try: return subprocess.check_output(cpp_command, cwd=root_dir, encoding="utf-8")