@@ -34,41 +34,41 @@ sub munge_GL_args {
34
34
}
35
35
36
36
sub generate_glew_xs {
37
- my $content ;
38
- for my $name (@_ ? @_ : sort keys %signature ) {
39
- my $item = $signature {$name };
40
- if ( is_manual($name ) ) {
41
- print " Skipping $name , already implemented in Modern.xs\n " ;
42
- next ;
43
- }
44
- my $argdata = $item -> {argdata };
45
- my @argdata = @{$argdata || []};
46
- my $type = $item -> {restype };
47
- my $glewImpl = $item -> {glewImpl };
48
- my $args = join ' , ' , map $_ -> [0], @argdata ;
49
- my $xs_args = join ' ' , map " $_ ->[1]$_ ->[0];\n " , @argdata ;
50
- my $binding_name = $item -> { has_ptr_arg } ? $ name . ' _c ' : $name ;
51
- my $decl = <<XS ;
37
+ my $content ;
38
+ for my $name (@_ ? @_ : sort keys %signature ) {
39
+ my $item = $signature {$name };
40
+ if ( is_manual($name ) ) {
41
+ print " Skipping $name , already implemented in Modern.xs\n " ;
42
+ next ;
43
+ }
44
+ my $argdata = $item -> {argdata };
45
+ my @argdata = @{$argdata || []};
46
+ my $type = $item -> {restype };
47
+ my $glewImpl = $item -> {glewImpl };
48
+ my $args = join ' , ' , map $_ -> [0], @argdata ;
49
+ my $xs_args = join ' ' , map " $_ ->[1]$_ ->[0];\n " , @argdata ;
50
+ my ( $binding_name ) = bind_names( $ name, $item ) ;
51
+ my $decl = <<XS ;
52
52
$type
53
53
$binding_name ($args );
54
54
XS
55
- $decl .= $xs_args ;
56
- my $error_check = $name eq " glGetError" ? " " : " OGLM_CHECK_ERR($name )" ;
57
- my $res = $decl . <<XS ;
55
+ $decl .= $xs_args ;
56
+ my $error_check = $name eq " glGetError" ? " " : " OGLM_CHECK_ERR($name )" ;
57
+ my $res = $decl . <<XS ;
58
58
CODE:
59
- OGLM_GLEWINIT@{[$error_check && "\n $error_check "]}
60
- XS
61
- if ( $item -> {glewtype } eq ' fun' and $glewImpl ) {
62
- $res .= " OGLM_AVAIL_CHECK($glewImpl , $name )\n " ;
63
- }
64
- my ($retcap , $retout ) = $type eq ' void' ? (' ' ,' ' ) : (' RETVAL = ' , " \n OUTPUT:\n RETVAL" );
65
- my $arg_list = $item -> {glewtype } eq ' var' ? " " : " ($args )" ;
66
- $res .= <<XS ;
67
- $retcap$name$arg_list ;@{[$error_check && "\n $error_check "]}$retout
59
+ OGLM_GLEWINIT@{[$error_check && "\n $error_check "]}
68
60
XS
69
- $content .= " $res \n " ;
61
+ if ( $item -> {glewtype } eq ' fun' and $glewImpl ) {
62
+ $res .= " OGLM_AVAIL_CHECK($glewImpl , $name )\n " ;
70
63
}
71
- return $content ;
64
+ my ($retcap , $retout ) = $type eq ' void' ? (' ' ,' ' ) : (' RETVAL = ' , " \n OUTPUT:\n RETVAL" );
65
+ my $arg_list = $item -> {glewtype } eq ' var' ? " " : " ($args )" ;
66
+ $res .= <<XS ;
67
+ $retcap$name$arg_list ;@{[$error_check && "\n $error_check "]}$retout
68
+ XS
69
+ $content .= " $res \n " ;
70
+ }
71
+ return $content ;
72
72
}
73
73
74
74
my $xs_code = generate_glew_xs(@ARGV );
0 commit comments