|< 1 2 >| | 17 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
WriteMakefile(
NAME => 'MyPackage',
VERSION_FROM => 'lib/MyPackage.pm', # finds $VERSION
PREREQ_PM => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/MyPackage.pm', # retrieve abstract from module
AUTHOR => 'A. U. Thor <a.u.thor@a.galaxy.far.far.away>') : ()),
LIBS => [''], # e.g., '-lm'
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => '-I.', # e.g., '-I. -I/usr/include/other'
CCFLAGS => '-TP',
XSOPT => '-C++',
TYPEMAPS => ['perlobject.map' ],
# Un-comment this if you add C files to link with later:
# OBJECT => '$(O_FILES)', # link all the C files too
);
1
2
3
4
5
6
7
8
9
10
11
cl -c -I. -TP -MD -Zi -DNDEBUG -O1 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-ID:\Perl\lib\CORE" MyPackage.c
MyPackage.c
D:\Perl\lib\CORE\win32.h(314) : error C2061: syntax error : identifier 'Stat_t'
D:\Perl\lib\CORE\win32.h(413) : error C2143: syntax error : missing ',' before '*'
D:\Perl\lib\CORE\win32.h(413) : error C2059: syntax error : '*'
D:\Perl\lib\CORE\perlio.h(105) : error C2143: syntax error : missing ',' before '*'
D:\Perl\lib\CORE\perlio.h(105) : error C2059: syntax error : '*'
D:\Perl\lib\CORE\perlio.h(106) : error C2143: syntax error : missing ',' before '*'
D:\Perl\lib\CORE\perlio.h(106) : error C2059: syntax error : '*'
D:\Perl\lib\CORE\perlio.h(108) : error C2143: syntax error : missing ',' before '*'
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use 5.008004;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'MyPackage',
VERSION_FROM => 'lib/MyPackage.pm', # finds $VERSION
PREREQ_PM => {}, # e.g., Module::Name => 1.1
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/MyPackage.pm', # retrieve abstract from module
AUTHOR => 'A. U. Thor <a.u.thor@a.galaxy.far.far.away>') : ()),
LIBS => [''], # e.g., '-lm'
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => '-I.', # e.g., '-I. -I/usr/include/other'
CCFLAGS  
; => '-TP',
XSOPT => '-C++',
TYPEMAPS => ['perlobject.map' ],
# Un-comment this if you add C files to link with later:
# OBJECT => '$(O_FILES)', # link all the C files too
);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifdef cplusplus
}
#endif
#include <iostream.h>
class MyClass {
public:
MyClass(char * my_favorite_argument) {
cout << "I'm constructin' my bad self ... " << my_favorite_argument << "\n";
}
~MyClass() { cout << "Destruction is a way of life for me.\n"; }
};
MODULE = MyPackage PACKAGE = MyPackage
MyClass *
MyClass::new(char * my_favorite_argument)
void
MyClass::DESTROY()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
TYPEMAP
MyClass * O_OBJECT
OUTPUT
# The Perl object is blessed into 'CLASS', which should be a
# char* having the name of the package for the blessing.
O_OBJECT
sv_setref_pv( $arg, CLASS, (void*)$var );
INPUT
O_OBJECT
if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) )
$var = ($type)SvIV((SV*)SvRV( $arg ));
else{
warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );
XSRETURN_UNDEF;
}
|< 1 2 >| | 17 Einträge, 2 Seiten |