swig clears Perl environment too agressively, especially it undefines "bool" definition. Due to this, following code snipplet is not compilable against Perl 5.16 and later:
#include "perl.h"
#include <stdbool.h>
bool some_function() {}
Compilation fails because swig-2.0.7/Lib/perl5/noembed.h is included after perl.h (which also pulls in stdbool.h header) but before stdbool.h. The noembed.h undefines bool but since stdbool.h was already included by perl.h, it is not included again. Due to this bool remains undefined.
Check https://bugzilla.redhat.com/show_bug.cgi?id=841245 for more details.
Attached patch solves this issue.
Proposed patch
Thanks for patch. I've modified to only undefine if the macro is defined by stdbool.h...
#ifdef bool
/* Leave if macro is from C99 stdbool.h */
#ifndef __bool_true_false_are_defined
#undef bool
#endif
#endif
Will be in swig-2.0.8.