Skip to content

Commit

Permalink
improve sdr check fix #811
Browse files Browse the repository at this point in the history
  • Loading branch information
jopohl committed Nov 1, 2020
1 parent 611ef15 commit 751a9a9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/urh/dev/native/ExtensionHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ def compiler_has_function(compiler, function_name, libraries, library_dirs, incl
try:
try:
file_name = os.path.join(tmp_dir, '{}.c'.format(function_name))
f = open(file_name, 'w')
f.write('int main(void) {\n')
f.write(' %s();\n' % function_name)
f.write('}\n')
f.close()
with open(file_name, 'w') as f:
f.write("void %s();\n" % function_name) # declare function to prevent Clang 12 error
f.write("int main(void) {\n")
f.write(" %s();\n" % function_name)
f.write("}\n")

# Redirect stderr to /dev/null to hide any error messages from the compiler.
devnull = open(os.devnull, 'w')
old_stderr = os.dup(sys.stderr.fileno())
Expand Down

0 comments on commit 751a9a9

Please sign in to comment.