Tue Feb 21 09:32:44 2012: Request 75193 was acted upon.
Transaction: Ticket created by SHAY
Queue: PAR-Packer
Subject: [PATCH] Fix build on Win32/VC++
Broken in: 1.012
Severity: Important
Owner: Nobody
Requestors: [email protected]
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=75193 >
The current version (1.012) of PAR-Packer does not build on Win32 with
VC++. There are two problems: myldr/boot.c attempts to include unistd.h
which VC++ does not provide (MinGW/gcc does, but VC++ should include
io.h for write() instead), and myldr/Makefile.PL wrongly uses $(CC)
rather than $(LD) to link boot.exe.
The attached patch fixes these problems.
There is still a warning (not an error that stops the build) from
myldr/mktmpdir.c which I'm not sure how best to solve:
myldr\mktmpdir.c(45) : warning C4013: 'getuid' undefined; assuming
extern returning int
The problem is that Win32/VC++ doeesn't have a getuid(), hence the
compiler's warning. The linker is happy, though, presumably because perl
provides a dummy function in win32/win32.c:
#define ROOT_UID ((uid_t)0)
uid_t getuid(void) { return ROOT_UID; }
but adding a declaration like
extern uid_t getuid(void);
to myldr/mktmpdir.h doesn't work at all.
win32.patch
Description: Binary data
