I created a branch 'c99-types' which makes the whole Lucy codebase switch to 
several standard macros defined in the C99 standard. This includes

* Integer min/max macros from stdint.h
  CHY_I32_MAX => INT32_MAX
* Integer literal macros from stdint.h
  CHY_I32_C => INT32_C
* printf type specifiers from inttypes.h
  I64P => PRId64

If any of the standard headers isn't found, the macros will be defined by 
Charmonizer.

On top of that, I tested switching from 'chy_bool_t' to 'bool' from stdbool.h 
(or from the C++ compiler when compiling as C++). This is a bit problematic 
since 'bool' is often defined by other headers.

Unfortunately, also the Perl headers define their own version of 'bool' under 
certain conditions. As a work-around, I had to add -DHAS_BOOL to the build 
options to make the Linux and Windows build work. This looks a bit sketchy and 
might cause problems with other Perl versions.

I successfully tested:

- MacOS 10.8 with stock Perl 5.12 (64-bit)
- Debian sid with stock Perl 5.14 (32-bit)
- Windows 7 with ActivePerl 5.16 and MSVC6 (32-bit)

Nick

Reply via email to