[cairo-commit] cairo-perl ChangeLog, 1.35, 1.36 MakeHelper.pm, 1.8,
1.9
Torsten Schoenfeld
commit at pdx.freedesktop.org
Sun Aug 20 11:33:24 PDT 2006
- Previous message: [cairo-commit] cairo-perl ChangeLog, 1.34, 1.35 MakeHelper.pm, 1.7,
1.8 Makefile.PL, 1.18, 1.19
- Next message: [cairo-commit] cairomm ChangeLog, 1.83, 1.84 Makefile.am, 1.10,
1.11 configure.in, 1.21, 1.22
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: tsch
Update of /cvs/cairo/cairo-perl
In directory kemper:/tmp/cvs-serv24173
Modified Files:
ChangeLog MakeHelper.pm
Log Message:
* MakeHelper.pm: Revert the last commit which used real enum types
instead of int; it broke compilation. Also alter the way unknown
enum types are dealt with: don't declare and implement stub
converters, just omit them. Still declare typemaps for them
though, to make xsubpp happy.
Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-perl/ChangeLog,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- ChangeLog 20 Aug 2006 18:09:47 -0000 1.35
+++ ChangeLog 20 Aug 2006 18:33:22 -0000 1.36
@@ -1,5 +1,13 @@
2006-08-20 tsch
+ * MakeHelper.pm: Revert the last commit which used real enum types
+ instead of int; it broke compilation. Also alter the way unknown
+ enum types are dealt with: don't declare and implement stub
+ converters, just omit them. Still declare typemaps for them
+ though, to make xsubpp happy.
+
+2006-08-20 tsch
+
* MakeHelper.pm: Add the infrastructure necessary to support
protecting the enum related things with #ifdef, if needed. Also
use the real enum types for the enum converters, instead of just
Index: MakeHelper.pm
===================================================================
RCS file: /cvs/cairo/cairo-perl/MakeHelper.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- MakeHelper.pm 20 Aug 2006 18:09:47 -0000 1.8
+++ MakeHelper.pm 20 Aug 2006 18:33:22 -0000 1.9
@@ -246,13 +246,15 @@
my $mangled = mangle ($type);
my $name = name ($type);
+ next unless @{$enums{$type}};
+
if (exists $enum_guards{$type}) {
print HEADER "#ifdef $enum_guards{$type}\n";
}
print HEADER <<"EOS";
-$type cairo_${name}_from_sv (SV * $name);
-SV * cairo_${name}_to_sv ($type val);
+int cairo_${name}_from_sv (SV * $name);
+SV * cairo_${name}_to_sv (int val);
#define Sv$mangled(sv) (cairo_${name}_from_sv (sv))
#define newSV$mangled(val) (cairo_${name}_to_sv (val))
EOS
@@ -355,27 +357,7 @@
my $name = name($type);
my @enum_values = @{$enums{$type}};
- # Create stub converters to make xsubpp happy even if the
- # current cairo doesn't have this type
- unless (@enum_values) {
- print ENUMS <<"EOS";
-int
-cairo_${name}_from_sv (SV * $name)
-{
- return 0;
-}
-
-SV *
-cairo_${name}_to_sv (int val)
-{
- return &PL_sv_undef;
-}
-
-EOS
-
- # Skip to next enum value
- next;
- }
+ next unless @enum_values;
my $value_list = join ", ", map { canonicalize($type, $enum_values[0]) } @enum_values[1..$#enum_values];
my $tree_from = if_tree_from (@enum_values);
@@ -386,7 +368,7 @@
}
print ENUMS <<"EOS";
-$type
+int
cairo_${name}_from_sv (SV * $name)
{
char * str = SvPV_nolen ($name);
@@ -398,7 +380,7 @@
}
SV *
-cairo_${name}_to_sv ($type val)
+cairo_${name}_to_sv (int val)
{
$tree_to
warn ("unknown $type value %d encountered", val);
- Previous message: [cairo-commit] cairo-perl ChangeLog, 1.34, 1.35 MakeHelper.pm, 1.7,
1.8 Makefile.PL, 1.18, 1.19
- Next message: [cairo-commit] cairomm ChangeLog, 1.83, 1.84 Makefile.am, 1.10,
1.11 configure.in, 1.21, 1.22
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cairo-commit
mailing list