summaryrefslogtreecommitdiff
path: root/embed.pl
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-05-09 07:29:33 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-05-09 07:29:33 +0000
commit3d42dc86375a150e698f9a14ae6be7a37e2ed575 (patch)
treec57e2739675c5a89af6b877d4ce7483c976ee5d6 /embed.pl
parentce5030a2e3d52efc311b379279a2db8219fc84b1 (diff)
downloadperl-3d42dc86375a150e698f9a14ae6be7a37e2ed575.tar.gz
Revert to Andy's first solution for nonnull attributes;
add the missing defines for non-threaded perls in perl.h p4raw-id: //depot/perl@24421
Diffstat (limited to 'embed.pl')
-rwxr-xr-xembed.pl19
1 files changed, 2 insertions, 17 deletions
diff --git a/embed.pl b/embed.pl
index 6487ff4ae0..50ec17faf3 100755
--- a/embed.pl
+++ b/embed.pl
@@ -212,23 +212,8 @@ sub write_protos {
}
$ret .= "\n\t\t\t__attribute__((nonnull))" if $flags =~ /N/;
if ( @nonnull ) {
- if ($has_context) {
- my @pos = map { $has_context ? $_ + 1 : $_ } @nonnull;
- $ret .= sprintf( <<ATTR,
-
-#ifdef USE_ITHREADS
- __attribute__((nonnull(%s)))
-#else
- __attribute__((nonnull(%s)))
-#endif
-ATTR
- join( ",", @pos ),
- join( ",", @nonnull ),
- );
- }
- else {
- $ret .= sprintf( "\n\t\t\t__attribute__((nonnull(%s)))", join( ",", @nonnull ) );
- }
+ my @pos = map { $has_context ? "pTHX_$_" : $_ } @nonnull;
+ $ret .= sprintf( "\n\t\t\t__attribute__((nonnull(%s)))", join( ",", @pos ) );
}
$ret .= ";";
$ret .= ' */' if $flags =~ /m/;