BEGIN { warn "Running ".__FILE__."\n" };
BEGIN
{
- require "../lib/Config.pm";
- die "../Config.pm:$@" if $@;
+ require "Config.pm";
+ die "Config.pm:$@" if $@;
Config::->import;
}
use File::Compare qw(compare);
}
$opt{CONFIG_H} ||= 'config.h';
+$opt{CORE_DIR} ||= '../lib/CORE';
warn "Writing $opt{CONFIG_H}\n";
close(SH);
-chmod(0666,"../lib/CORE/config.h");
-copy("$file.new","../lib/CORE/config.h") || die "Cannot copy:$!";
-chmod(0444,"../lib/CORE/config.h");
+chmod(0666,"$opt{CORE_DIR}/$opt{CONFIG_H}");
+copy("$file.new","$opt{CORE_DIR}/$opt{CONFIG_H}") || die "Cannot copy:$!";
+chmod(0444,"$opt{CORE_DIR}/$opt{CONFIG_H}");
if (compare("$file.new",$file))
{
RETVAL = PerlProc_DynaLoad(filename);
}
else
- RETVAL = (void*) GetModuleHandle(NULL);
+ RETVAL = (void*) Win_GetModuleHandle(NULL);
DLDEBUG(2,PerlIO_printf(Perl_debug_log," libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
extern "C" {
#endif
+#ifndef _WINCE
+
#define WIN32_LEAN_AND_MEAN
#ifdef __GNUC__
# define Win32_Winsock
#endif
#include <windows.h>
+#else
+/*_WINCE*/
+#ifndef FAR
+#define FAR
+#endif
+
+#define PASCAL __stdcall
+#define WINAPI __stdcall
+
+#undef WORD
+typedef int BOOL;
+typedef unsigned short WORD;
+typedef void* HANDLE;
+typedef void* HWND;
+typedef int (FAR WINAPI *FARPROC)();
+
+typedef unsigned long DWORD;
+typedef void *PVOID;
+
+#define IN
+#define OUT
+
+#ifndef UNDER_CE
+typedef struct _OVERLAPPED {
+ DWORD Internal;
+ DWORD InternalHigh;
+ DWORD Offset;
+ DWORD OffsetHigh;
+ HANDLE hEvent;
+} OVERLAPPED, *LPOVERLAPPED;
+#endif
+
+#undef HOST_NOT_FOUND
+
+#endif /*_WINCE*/
+
/* Too late to include winsock2.h if winsock.h has already been loaded */
#ifndef _WINSOCKAPI_
# include <winsock2.h>
-binmode STDOUT;
+if (@ARGV) {
+ open ICO, ">", shift or die $!;
+} else {
+ *ICO= *STDOUT;
+}
+binmode ICO;
while (<DATA>) {
chomp;
- print pack "H*", $_;
+ print ICO pack "H*", $_;
}
# Create new hex data with
0000000000000000000000000000ffff9e5cfbb77420fd9b7865fd9b2074fd5b
7320fd5b6e20fd137573f0017072e0036c65e0032077e4076e20e6076577c30f
6720ff9f6520ffff6f6effff6e20
+
* License or the Artistic License, as specified in the README file.
*/
+#ifndef UNDER_CE
#define CHECK_HOST_INTERP
+#endif
#ifndef ___PerlHost_H___
#define ___PerlHost_H___
+#ifndef UNDER_CE
#include <signal.h>
+#endif
#include "iperlsys.h"
#include "vmem.h"
#include "vdir.h"
FILE*
PerlStdIOFdupopen(struct IPerlStdIO* piPerl, FILE* pf)
{
+#ifndef UNDER_CE
FILE* pfdup;
fpos_t pos;
char mode[3];
fsetpos(pfdup, &pos);
}
return pfdup;
+#else
+ return 0;
+#endif
}
struct IPerlStdIO perlStdIO =
LPSTR*
CPerlHost::Lookup(LPCSTR lpStr)
{
+#ifdef UNDER_CE
+ if (!m_lppEnvList || !m_dwEnvCount)
+ return NULL;
+#endif
if (!lpStr)
return NULL;
return (LPSTR*)bsearch(&lpStr, m_lppEnvList, m_dwEnvCount, sizeof(LPSTR), lookup);
#ifdef PERL_IMPLICIT_SYS
+/* WINCE: include replaced by:
+extern "C" void win32_checkTLS(PerlInterpreter *host_perl);
+*/
#include "perlhost.h"
void
dTHX;
if (host_perl != my_perl) {
int *nowhere = NULL;
- *nowhere = 0;
+#ifdef _WIN_CE
+ printf(" ... bad in win32_checkTLS\n");
+ printf(" %08X ne %08X\n",host_perl,my_perl);
+#endif
abort();
}
}
+#ifdef UNDER_CE
+int GetLogicalDrives() {
+ return 0; /* no logical drives on CE */
+}
+int GetLogicalDriveStrings(int size, char addr[]) {
+ return 0; /* no logical drives on CE */
+}
+/* TBD */
+DWORD GetFullPathNameA(LPCSTR fn, DWORD blen, LPTSTR buf, LPSTR *pfile) {
+ return 0;
+}
+/* TBD */
+DWORD GetFullPathNameW(CONST WCHAR *fn, DWORD blen, WCHAR * buf, WCHAR **pfile) {
+ return 0;
+}
+/* TBD */
+DWORD SetCurrentDirectoryA(LPSTR pPath) {
+ return 0;
+}
+/* TBD */
+DWORD SetCurrentDirectoryW(CONST WCHAR *pPath) {
+ return 0;
+}
+int xcesetuid(uid_t id){return 0;}
+int xceseteuid(uid_t id){ return 0;}
+int xcegetuid() {return 0;}
+int xcegeteuid(){ return 0;}
+#endif
+
+/* WINCE??: include "perlhost.h" */
+
EXTERN_C void
perl_get_host_info(struct IPerlMemInfo* perlMemInfo,
struct IPerlMemInfo* perlMemSharedInfo,
* Borland's CRT does the right thing to argv[0] already. */
char szModuleName[MAX_PATH];
- GetModuleFileName(NULL, szModuleName, sizeof(szModuleName));
+ Win_GetModuleFileName(NULL, szModuleName, sizeof(szModuleName));
(void)win32_longpath(szModuleName);
argv[0] = szModuleName;
#endif
setmode( fileno( stderr ), O_BINARY );
_fmode = O_BINARY;
#endif
+
+#ifndef UNDER_CE
DisableThreadLibraryCalls((HMODULE)hModule);
+#endif
+
w32_perldll_handle = hModule;
set_w32_module_name();
break;
return TRUE;
}
+
#if defined(USE_ITHREADS) && defined(PERL_IMPLICIT_SYS)
EXTERN_C PerlInterpreter *
perl_clone_host(PerlInterpreter* proto_perl, UV flags) {
bManageDirectory = 0;
driveBits = GetLogicalDrives();
if (GetLogicalDriveStrings(sizeof(szBuffer), szBuffer)) {
- char* pEnv = GetEnvironmentStrings();
+ char* pEnv = (char*)GetEnvironmentStrings();
char* ptr = szBuffer;
for (index = 0; index < driveCount; ++index) {
if (driveBits & (1<<index)) {
#ifndef ___VMEM_H_INC___
#define ___VMEM_H_INC___
+#ifndef _WIN_CE
#define _USE_MSVCRT_MEM_ALLOC
+#endif
#define _USE_LINKED_LIST
// #define _USE_BUDDY_BLOCKS
DllExport void *win32_signal_context(void);
#define PERL_GET_SIG_CONTEXT win32_signal_context()
+#ifdef _WIN_CE
+#define Win_GetModuleHandle XCEGetModuleHandleA
+#define Win_GetProcAddress XCEGetProcAddressA
+#define Win_GetModuleFileName XCEGetModuleFileNameA
+#define Win_CreateSemaphore CreateSemaphoreW
+#else
+#define Win_GetModuleHandle GetModuleHandle
+#define Win_GetProcAddress GetProcAddress
+#define Win_GetModuleFileName GetModuleFileName
+#define Win_CreateSemaphore CreateSemaphore
+#endif
+
#endif /* _INC_WIN32_PERL5 */