edits
authorPeizhao Ou <peizhaoo@uci.edu>
Wed, 24 Feb 2016 08:26:29 +0000 (00:26 -0800)
committerPeizhao Ou <peizhaoo@uci.edu>
Wed, 24 Feb 2016 08:26:29 +0000 (00:26 -0800)
src/edu/uci/eecs/codeGenerator/CodeGenerator.java

index 93809c6..41a5bdd 100644 (file)
@@ -178,6 +178,14 @@ public class CodeGenerator {
                        additionIdx = 0;
                        curAddition = additions.codeAdditions.get(0);
                }
+               
+               // Include the header for C/C++ files (.c/.cc/.cpp)
+               String name = file.getName();
+               if (name.endsWith(".c") || name.endsWith(".cc") || name.endsWith(".cpp")) {
+                       newCode.addLine(CodeGeneratorUtils.Comment("Add the" + SpecNaming.CDSSpecGeneratedHeader + " header file"));
+                       newCode.addLine(CodeGeneratorUtils.IncludeHeader(SpecNaming.CDSSpecGeneratedHeader));
+                       newCode.addLine("");
+               }
 
                try {
                        br = new BufferedReader(new FileReader(file));