lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

Sorry not to menion it here earlier, but I've been doing the same thing and
everything has always worked as expected. Each time I've installed a new
release, I've had to go into the source and add the cplusplus definition. It
would be nice it it shipped that way.

Michael

----- Original Message ----- 
From: "Daniel Walker" <djwalker@webmail.co.za>
To: <lua@bazar2.conectiva.com.br>
Sent: Monday, September 27, 2004 8:41 AM
Subject: lua.h and c++


> I love the language, but whenever I install Lua on a
> machine I need to make an alteration to the header file.
>
> The following section allows C programs to use Lua
> functions if the Lua libraries are compiled in C.
>
> /* mark for all API functions */
> #ifndef LUA_API
> #define LUA_API extern
> #endif
>
> It works for C++ only if the libraries are compiled in C++.
> To get both C and C++ programs working with the C library,
> I change that section of the lua.h header to the following:
>
> /* mark for all API functions */
> #ifndef LUA_API
> #ifdef __cplusplus
> #define LUA_API extern "C"
> #else
> #define LUA_API extern
> #endif
> #endif
>
> Now it works beautifully and transparently, but isn't quite
> standard. I wonder... could this possibly be made the
> standard for lua.h in future releases of lua?
> _____________________________________________________________________
> For super low premiums ,click here http://www.dialdirect.co.za/quote
>