Browse Source

COMP: Added constructor to cmDependsFortranFile to avoid using initializer list. Also included assert.h.

Brad King 21 years ago
parent
commit
f1b52f3f98
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Source/cmDependsFortran.cxx

+ 5 - 1
Source/cmDependsFortran.cxx

@@ -21,6 +21,7 @@
 #include "cmDependsFortranLexer.h"  /* Interface to lexer object.  */
 #include "cmDependsFortranParser.h" /* Interface to parser object.  */
 
+#include <assert.h>
 #include <stack>
 
 //----------------------------------------------------------------------------
@@ -37,6 +38,9 @@ extern "C"
 // Define parser object internal structure.
 struct cmDependsFortranFile
 {
+  cmDependsFortranFile(FILE* file, YY_BUFFER_STATE buffer,
+                       const std::string& dir):
+    File(file), Buffer(buffer), Directory(dir) {}
   FILE* File;
   YY_BUFFER_STATE Buffer;
   std::string Directory;
@@ -215,7 +219,7 @@ int cmDependsFortranParser_FilePush(cmDependsFortranParser* parser,
     YY_BUFFER_STATE current =
       cmDependsFortranLexer_GetCurrentBuffer(parser->Scanner);
     std::string dir = cmSystemTools::GetParentDirectory(fname);
-    cmDependsFortranFile f = {file, current, dir};
+    cmDependsFortranFile f(file, current, dir);
     YY_BUFFER_STATE buffer =
       cmDependsFortran_yy_create_buffer(0, 16384, parser->Scanner);
     cmDependsFortran_yy_switch_to_buffer(buffer, parser->Scanner);