I was working on fixing up some stuff on OpenSolaris, and I had Ragel
6.4 failing to build. The problem is that CS has not one but two
definitions inside OpenSolaris's system headers.

The patch is _very_ ugly but gets the job done; sincerely I'd recommend
to rename the method in something slightly longer to avoid macros on
other systems too.

HTH!

-- 
Diego Elio Pettenò — “Flameeyes”
http://blog.flameeyes.eu/
diff -ur ragel-6.4.orig/ragel/cdcodegen.cpp ragel-6.4/ragel/cdcodegen.cpp
--- ragel-6.4.orig/ragel/cdcodegen.cpp	2009-03-21 21:15:43.000000000 +0100
+++ ragel-6.4/ragel/cdcodegen.cpp	2009-03-27 23:19:39.105379307 +0100
@@ -21,8 +21,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 
-#include "cdcodegen.h"
 #include "ragel.h"
+#include "cdcodegen.h"
 #include "redfsm.h"
 #include "gendata.h"
 #include <sstream>
diff -ur ragel-6.4.orig/ragel/ragel.h ragel-6.4/ragel/ragel.h
--- ragel-6.4.orig/ragel/ragel.h	2009-03-22 02:26:32.000000000 +0100
+++ ragel-6.4/ragel/ragel.h	2009-03-27 23:18:21.551766402 +0100
@@ -30,6 +30,11 @@
 #include "config.h"
 #include "common.h"
 
+#ifdef CS
+#warning "There is a CS macro in the system, we're undefining it"
+# undef CS
+#endif
+
 #define PROGNAME "ragel"
 
 /* Target output style. */
diff -ur ragel-6.4.orig/ragel/rbxgoto.cpp ragel-6.4/ragel/rbxgoto.cpp
--- ragel-6.4.orig/ragel/rbxgoto.cpp	2009-01-04 21:39:52.000000000 +0100
+++ ragel-6.4/ragel/rbxgoto.cpp	2009-03-27 23:25:24.473960528 +0100
@@ -23,8 +23,8 @@
 #include <stdio.h>
 #include <string>
 
-#include "rbxgoto.h"
 #include "ragel.h"
+#include "rbxgoto.h"
 #include "redfsm.h"
 #include "bstmap.h"
 #include "gendata.h"
diff -ur ragel-6.4.orig/ragel/rubyfflat.cpp ragel-6.4/ragel/rubyfflat.cpp
--- ragel-6.4.orig/ragel/rubyfflat.cpp	2009-01-04 21:39:52.000000000 +0100
+++ ragel-6.4/ragel/rubyfflat.cpp	2009-03-27 23:21:50.309156000 +0100
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 
+#include "ragel.h"
 #include "rubyfflat.h"
 
 void RubyFFlatCodeGen::GOTO( ostream &out, int gotoDest, bool inFinish )
diff -ur ragel-6.4.orig/ragel/rubyflat.cpp ragel-6.4/ragel/rubyflat.cpp
--- ragel-6.4.orig/ragel/rubyflat.cpp	2009-01-04 21:39:52.000000000 +0100
+++ ragel-6.4/ragel/rubyflat.cpp	2009-03-27 23:21:24.564040150 +0100
@@ -20,8 +20,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
 
-#include "rubyflat.h"
 #include "ragel.h"
+#include "rubyflat.h"
 #include "redfsm.h"
 #include "gendata.h"
 

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to