소스 검색

simplify amalgamated header; remove duplicate extern 'C'

Julius Pfrommer 7 년 전
부모
커밋
51288af66c
1개의 변경된 파일2개의 추가작업 그리고 10개의 파일을 삭제
  1. 2 10
      tools/amalgamate.py

+ 2 - 10
tools/amalgamate.py

@@ -58,10 +58,7 @@ if is_c:
 else:
     file.write(u'''#ifndef %s
 #define %s
-
-#ifdef __cplusplus
-extern "C" {
-#endif\n''' % (outname.upper() + u"_H_", outname.upper() + u"_H_") )
+''' % (outname.upper() + u"_H_", outname.upper() + u"_H_") )
 
 for fname in args.inputs:
     with io.open(fname, encoding='utf8', errors='replace') as infile:
@@ -78,12 +75,7 @@ for fname in args.inputs:
         print ("done."),
 
 if not is_c:
-    file.write(u'''
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif /* %s */\n''' % (outname.upper() + u"_H_"))
+    file.write(u"#endif /* %s */\n" % (outname.upper() + u"_H_"))
 
 # Ensure file is written to disk.
 # See https://stackoverflow.com/questions/13761961/large-file-not-flushed-to-disk-immediately-after-calling-close