Win32-Daemon
view release on metacpan or search on metacpan
Win32Perl.h view on Meta::CPAN
// Win32Perl.h
// -----------
// This header is used exclusively to provide seemless support for Perl extensions
// under the Win32 platform. It could easily be adapted to other platforms as well.
//
// The bulk of this header is to provide extension development without necesitating
// the need to adopt XS or other meta language formats.
// We prefer to use our own C/C++ coding styles than that which XS dictates.
//
// This file adapts to the version of Perl being used: 5.003, 5.004, 5.005, 5.006
// 5.008 with or without support for PERL_OBJECT.
//
// 1999.11.14 roth
//
//
// TO USE THIS:
// This header is intended to be used in conjunction with the
// preWin32Perl.h header.
// Simply add the follwing line to your Perl extension:
//
// #include <Win32Perl.h>
//
// That is it. DO NOT add references to extern.h, Perl.h or XSub.h in
// your extension. The preWin32Perl.h already does this. It is important
// to abide by this because the order of defining macros and including
// headers is important!
// 2003.03.01 roth
//
// (c) 1998-2003 Dave Roth
// Courtesy of Roth Consulting
// http://www.roth.net/
#ifndef _WIN32PERL_H_
#ifndef _PREWIN32_PERL_H
#include <PreWin32Perl.h>
#endif // _PREWIN32_PERL_H
#include <tchar.h>
#include "patchlevel.h"
//
// Various macro definitions for various Perl builds (refer to preWin32Perl.h):
// --------------------------------------------------
// v5.008 Core (default from ActiveState.com)
// WIN32,_WINDOWS,EMBED,MSWIN32,HAVE_DES_FCRYPT,MULTIPLICITY,PERL_IMPLICIT_CONTEXT,PERL_IMPLICIT_SYS,PERL_MSVCRT_READFIX,PERL_NO_GET_CONTEXT,PERL_POLLUTE,USE_ITHREADS,NO_STRICT,USE_PERLIO,USE_ITHREADS,USE_LARGE_FILES
//
// v5.006 Core (default from ActiveState.com)
// WIN32,_WINDOWS,EMBED,MSWIN32,HAVE_DES_FCRYPT,MULTIPLICITY,PERL_IMPLICIT_CONTEXT,PERL_IMPLICIT_SYS,PERL_MSVCRT_READFIX,PERL_NO_GET_CONTEXT,PERL_POLLUTE,USE_ITHREADS
//
// v5.005 ActiveState
// EMBED,MSWIN32,PERL_OBJECT
//
// v5.005 Core
// EMBED,MSWIN32
//
// v5.004 ActiveState
// EMBED,MSWIN32,PERL_OBJECT
# define _WIN32PERL_H_
# define _WIN32PERL_H_VERSION 20080321
# ifdef PERLVER
//# undef PERLVER
# endif // PERLVER
// Update REVISION and VERSION values. Some older versions did not set this
#ifndef PERL_VERSION
// Now test for version 5.005 of perl...
# if PATCHLEVEL == 5
# define PERL_REVISION 5
# define PERL_VERSION 5
# else
# ifdef PERL_OBJECT
# define PERL_REVISION 5
# define PERL_VERSION 4
# else
# define PERL_REVISION 5
# define PERL_VERSION 3
# endif // PERL_OBJECT
# endif // PATCHLEVEL == 5
#endif // ! PERL_VERSION
#define PERL_OBJECT_INSTANCE_DELIMITER ,
#if PERL_VERSION == 10
# define PERL_VER_STRING "5.10"
# define FILE_EXTENSION "DLL"
//# ifdef PERL_OBJECT
// v5.8 handled things as 5.6 did:
// The pTHX macro is the FULL prototype such as: register PerlInterpreter *my_perl
// and aTHX macro is the argument such as: my_perl
// Then under certain screwed up conditions pTHX becomes void. Yes void. Sigh. So
// this, of course, breaks everything since void itself is not a valid arguement. Idiots.
// Luckily if this occurs USE_THREADS is defined so we can use this to test...
# ifdef USE_THREADS
# define PERL_OBJECT_CLASS perl_thread*
# define PERL_OBJECT_CLASS_STRING "pTHX"
# define PERL_OBJECT_PROTO pTHXo_
# define PERL_OBJECT_PROTO1 perl_thread *thr
# define PERL_OBJECT_ARGS aTHXo_
# define PERL_OBJECT_ARG aTHXo
# define PERL_OBJECT_INSTANCE aTHX
# else
# define PERL_OBJECT_INSTANCE my_perl
# define PERL_OBJECT_CLASS PerlInterpreter*
# define PERL_OBJECT_CLASS_STRING "PerlInterpreter"
# endif
# pragma message( "...using the " PERL_OBJECT_CLASS_STRING )
#endif
#if PERL_VERSION == 8
# define PERL_VER_STRING "5.8"
# define FILE_EXTENSION "DLL"
//# ifdef PERL_OBJECT
// v5.8 handled things as 5.6 did:
// The pTHX macro is the FULL prototype such as: register PerlInterpreter *my_perl
( run in 2.617 seconds using v1.01-cache-2.11-cpan-0b58ddf2af1 )