Skip to content

Commit

Permalink
Remove CPP directives in favor of plain C
Browse files Browse the repository at this point in the history
  • Loading branch information
mgruberman committed Sep 24, 2012
1 parent a25384a commit 1443db4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
8 changes: 8 additions & 0 deletions Changes
@@ -1,5 +1,13 @@
Revision history for Judy

0.41

Bug fixes:

* ExtUtils::ParseXS circa 3.16 no longer handles CPP directives in typemap
files. The typemap file now uses plain C instead of any CPP directives
for conditional compilation.

0.40

Bug fixes:
Expand Down
33 changes: 16 additions & 17 deletions typemap
Expand Up @@ -55,10 +55,10 @@ T_IWORD
}
}
else {
#if LONGSIZE == IVSIZE
if (LONGSIZE == IVSIZE) {
assert( LONG_MIN <= SvIV($arg) && SvIV($arg) <= LONG_MAX );
$var = SvIV($arg);
#else
} else {
if ( SvIV($arg) > LONG_MAX ) {
$var = LONG_MAX;
warn(\"Truncating %\"IVdf\" to %ld because your number is larger than fits in a signed integer\",
Expand All @@ -72,7 +72,7 @@ T_IWORD
else {
$var = SvIV($arg);
}
#endif
}
}


Expand All @@ -95,22 +95,21 @@ T_UWORD
SvIV($arg));
}
}
#if (LONGSIZE == UVSIZE)
else {
$var = SvUV($arg);
}
#else
else if ( SvUV($arg) > ULONG_MAX ) {
$var = LONG_MAX;
warn(\"Truncating %\"UVuf\" to %lu because your number is larger than fits in an unsigned integer\",
SvUV($arg), ULONG_MAX);
}
else {
$var = SvUV($arg);
if (LONGSIZE == UVSIZE) {
$var = SvUV($arg);
}
else {
if (SvUV($arg) > ULONG_MAX) {
$var = LONG_MAX;
warn(\"Truncating %\"UVuf\" to %lu because your number is larger than fits in an unsigned integer\",
SvUV($arg), ULONG_MAX);
}
else {
$var = SvUV($arg);
}
}
}
#endif
/* This line added to get the immediately preceding #endif to work
properly in generated C source. */

OUTPUT
T_STR
Expand Down

0 comments on commit 1443db4

Please sign in to comment.