lua-users home
lua-l archive

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

El 07/12/2004, a las 20:32, Mike Pall escribió:


Roberto Ierusalimschy wrote:
the #ifdef logic in luaconf.h for loadlib support does not work properly
on a variety of systems.

Can you be more specific?


Also the defines for Mac OS X were never actually used because both
USE_DLOPEN and USE_DYLD get defined (one in config, the other in luaconf.h).
And the former has priority in loadlib.c. Luckily gcc on OS X does not
define BSD or you'd get into even more trouble.

I have tested which macros get defined (using "touch blah.c ; cpp -dM blah.c"), and it does *not* define "BSD". The relevant ones for detecting operating system/architecture are the following:

#define _ARCH_PPC 1
#define __ppc__ 1
#define __APPLE__ 1
#define __MACH__ 1
#define __POWERPC__ 1
#define _BIG_ENDIAN 1
#define __BIG_ENDIAN__ 1

I tend to write the test for MacOS X like:

#if defined(__APPLE__) && defined(__ppc__)
  /* MacOS X code goes here */

I think the test is strong enough, I have never experimented problems with it.



Attachment: PGP.sig
Description: Mensaje firmado digitalmente