Browse Source

Windows fixes:
strip CRs from preprocessor output
replace \ with / in tempfile name


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43118 15284696-431f-4ddb-bdfa-cd5b030d7da7

Glynn Clements 15 years ago
parent
commit
0625f5e451
1 changed files with 3 additions and 2 deletions
  1. 3 2
      lib/python/ctypes/ctypesgencore/parser/preprocessor.py

+ 3 - 2
lib/python/ctypes/ctypesgencore/parser/preprocessor.py

@@ -84,7 +84,7 @@ def symbol_to_token(sym):
 
 def create_token(type, value, production=None):
     '''Create a token of type and value, at the position where 'production'
-    was reduced.  Don't specify production if the token is built-in'''
+    was reduced.  Don`t specify production if the token is built-in'''
     t = lex.LexToken()
     t.type = type
     t.value = value
@@ -137,7 +137,7 @@ class PreprocessorParser(object):
             cmd += " -I%s" % path 
         for define in self.defines:
             cmd += ' "-D%s"' % define
-        cmd += " " + filename
+        cmd += " " + filename.replace('\\','/')
 
         self.cparser.handle_status(cmd)
         
@@ -158,6 +158,7 @@ class PreprocessorParser(object):
         define_lines = []
         
         for line in ppout.split("\n"):
+            line = line.rstrip('\r')
             line = line + "\n"
             if line.startswith("# "):
                 # Line number information has to go with both groups