lua-users home
lua-l archive

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


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