[ragel-users] BUG while processing import directive

ragel-user at jgoettgens.de ragel-user at jgoettgens.de
Tue Jul 19 17:15:51 UTC 2011


some patches apply to the Windows OS in general, which is handled by _WIN32. 
Even if you compile Ragel using mingw, _WIN32 might be defined. _MSC_VER 
applies only to the Microsoft C/C++ compiler and its specific runtime 
library. The runtime libraries of the other C/C++ compilers might or might 
not show subtle differences. In order to really clean up the code and one 
should first get all the other compilers (Microsoft, Intel, Digital Mars, 
GNU in mingw and cygwin flavor, Borland, ...), study their runtime libs and 
then make a decision about the preprocessor symbols. Also, runtime libs 
might be different for different compiler versions. Is it worth the effort?

The current MSC runtime libs more or less treat '/' and '\' equivalently, as 
do the GNU compilers, but assuming that '/' is generally supported is a bit 
naive. If the goal is to compile Ragel specs on a Windows machine, one can 
rely on the behavior of a specific runtime lib to reduce the amount of 
written code. If the goal is to make Ragel 100% cross platform, one should 
consider treating any path issues inside Ragel. Also, how do you want to 
handle code that comes from a Windows machine that gets ported to a POSIX 
environment? You probably have to allow '\' on Linux systems, too. That's a 
No-go. None of these considerations affect the generated code of the FSMs. 
So, is it worth the effort?

Once the basic source code is cross platform the next step is to make the 
build system cross platform, possibly using cmake. I would be willing to 
invest some time, but not because Ragel needs it, but because it is on my 
list of things to study. Again, the output of Ragel is not affected by this.

My suggestion for treating paths is to not allow native path seps if they 
differ from '/'. In rare cases names would need some patching in order to 
get a valid path for a specific platform. Currently, my patches for Windows 
could then be removed.


ragel-users mailing list
ragel-users at complang.org

More information about the ragel-users mailing list