[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_error() and C++
- From: David Burgess <dburgess@...>
- Date: Thu, 4 Aug 2005 08:43:48 +1000
This mail I forward on behalf of Nikolas Bowe.
I edited it slightly.
Message Follows:
--------------------
regarding your patch to allow C++ exceptions:
I checked the docs and /GX is supposed to be equivilant to /EHsc. so
you only need to compile everything with /EHsc-
Also on visual studio 7.1 (aka .net 2003) you can right click on ldo.c
and change its properties to compile as C++. this saves you from
changing the name. matter of personal taste I guess.
You mentioned that you wondered what gcc did.
I tried a small C source file that I put try catch into and compiled
it with "g++" instead of "gcc" (3.4.1) and it worked perfectly.
I didnt try to throw the exception through code compiled as C (ie
compiled with "gcc") though.
so at the worst case the only thing you have to do is to compile
everything with "g++" instead of "gcc".
(this assumes of course that the information at
http://lua-users.org/wiki/BuildingLua is correct and lua builds
cleanly as C++)
Looking at the docs for gcc at
http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/gcc/Code-Gen-Options.html
suggests that if you dont want to compile all of lua as C++ but still
want to use C++ exceptions thrown through the C code then you need to
compile ldo.c as C++ (ie with "g++"), but all the other C files you
can compile with "gcc" if you use the "-fexceptions " switch
Thanks again for your post.
Nikolas Bowe
Programmer
Infinite Interactive