lua-users home
lua-l archive

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


--- "Philip D. Bober" wrote:
> But if that were in the original files, it wouldn't affect C
> users (because of the #ifdef __cplusplus), only C++ users.

Right, it would affect them negatively. Lua can be compiled as C or
as C++. If you compile it as C++ then names will be appropriately
mangled and you don't need the 'extern "C"' to link. You only need
the 'extern "C"' if you compile the Lua source as C, in which case
you don't need to add 'extern "C"' it to the Lua headers, you can
just create a new header:

// lua.hpp
extern "C" {
#include "lua.h"
}

In other words, the way it's setup now is more flexible.

Cheers,
Eric


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com