oops, one more fix, hopefully the last
authorMorgan Deters <mdeters@gmail.com>
Tue, 4 Oct 2011 01:54:38 +0000 (01:54 +0000)
committerMorgan Deters <mdeters@gmail.com>
Tue, 4 Oct 2011 01:54:38 +0000 (01:54 +0000)
config/antlr.m4
src/parser/antlr_input.cpp
src/parser/memory_mapped_input_buffer.cpp

index b376c0ecc0c16b670099b08d576f124aff88a14f..27e9200e5714efcafc28be3ed82effbe78405235 100644 (file)
@@ -94,7 +94,7 @@ AC_DEFUN([AC_LIB_ANTLR],[
     ],
     [
       AC_MSG_RESULT([found it (must be antlr3 3.2 or similar)])
-      CVC4_ANTLR3_OLD_INPUT_STREAM=0
+      CVC4CPPFLAGS="${CVC4CPPFLAGS:+$CVC4CPPFLAGS }-DCVC4_ANTLR3_OLD_INPUT_STREAM"
     ],
         [
           AC_MSG_RESULT(failed)
@@ -111,7 +111,6 @@ AC_DEFUN([AC_LIB_ANTLR],[
             ],
             [
               AC_MSG_RESULT([found it (must be antlr3 3.4 or similar)])
-              CVC4_ANTLR3_OLD_INPUT_STREAM=0
             ],
                 [
                   AC_MSG_ERROR([cannot figure out how to create an antlr3 input stream, bailing..])
@@ -120,8 +119,6 @@ AC_DEFUN([AC_LIB_ANTLR],[
         ]
   )
 
-  AC_DEFINE_UNQUOTED(CVC4_ANTLR3_OLD_INPUT_STREAM, [$CVC4_ANTLR3_OLD_INPUT_STREAM], [Defined to 1 if we have libantlr3c v3.2 or equivalent.])
-
   # Return the old compile variables and pop the language.
   LIBS="$OLD_LIBS"
   CPPFLAGS="$OLD_CPPFLAGS"
index 6ec1c584639be0e18f95044615846a8aaa827de6..ec3b7077ee8701f05189e89d9676249656e62421 100644 (file)
@@ -69,7 +69,7 @@ AntlrInputStream::newFileInputStream(const std::string& name,
     input = MemoryMappedInputBufferNew(name);
   } else {
     // libantlr3c v3.2 isn't source-compatible with v3.4
-#if CVC4_ANTLR3_OLD_INPUT_STREAM
+#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM
     input = antlr3AsciiFileStreamNew((pANTLR3_UINT8) name.c_str());
 #else /* CVC4_ANTLR3_OLD_INPUT_STREAM */
     input = antlr3FileStreamNew((pANTLR3_UINT8) name.c_str(), ANTLR3_ENC_8BIT);
@@ -117,7 +117,7 @@ AntlrInputStream::newStreamInputStream(std::istream& input,
   }
 
   /* Create an ANTLR input backed by the buffer. */
-#if CVC4_ANTLR3_OLD_INPUT_STREAM
+#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM
   pANTLR3_INPUT_STREAM inputStream =
       antlr3NewAsciiStringInPlaceStream((pANTLR3_UINT8) basep,
                                         cp - basep,
@@ -143,7 +143,7 @@ AntlrInputStream::newStringInputStream(const std::string& input,
   char* inputStr = strdup(input.c_str());
   char* nameStr = strdup(name.c_str());
   AlwaysAssert( inputStr!=NULL && nameStr!=NULL );
-#if CVC4_ANTLR3_OLD_INPUT_STREAM
+#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM
   pANTLR3_INPUT_STREAM inputStream =
       antlr3NewAsciiStringInPlaceStream((pANTLR3_UINT8) inputStr,
                                         input.size(),
index 1c0f76e1e28f150ebaa87eb5040252c55bd11b5a..f0b7a9d2cda8c03d458039de955858241ca1b8f3 100644 (file)
@@ -61,7 +61,7 @@ pANTLR3_INPUT_STREAM MemoryMappedInputBufferNew(const std::string& filename) {
   // Call the common 8 bit ASCII input stream handler
   // Initializer type thingy doobry function.
   //
-#if CVC4_ANTLR3_OLD_INPUT_STREAM
+#ifdef CVC4_ANTLR3_OLD_INPUT_STREAM
   antlr3AsciiSetupStream(input, ANTLR3_CHARSTREAM);
 #else /* CVC4_ANTLR3_OLD_INPUT_STREAM */
   antlr38BitSetupStream(input);