lua-users home
lua-l archive

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

On 02/21/2013 02:51 PM, Roberto Ierusalimschy wrote:
Then I added

#ifndef _WIN32
#define __cdecl

static void __cdecl laction (int i) {

Why is this needed?

Because signal handlers require it:

Are you sure?  According to this page, it seems that this declaration
should not be necessary:

   This is the default calling convention for C and C++ programs.
   Because the C naming and calling conventions are the default, the
   only time you need to use __cdecl is when you have specified the /Gz
   (stdcall) or /Gr (fastcall) compiler option.

Like I said in my original mail

  "to make both MS-VC with my preferred settings
   and a bunch of other compilers happy."

I throw this software embedding Lua at many compilers and ignore
your makefiles.

"Traditionally" this _cdecl or __cdecl has been needed for callbacks
in MS environments. Also for things like qsort(). I'm surprised you
aren't familiar with this quirk.