Skip to content

Improved ext/ext_skel_win32.php #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions ext/ext_skel_win32.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
/* $Id$ */

if (php_sapi_name() != "cli") {
echo "Please run this script using the CLI version of PHP\n";
exit;
exit ("Please run this script using the CLI version of PHP\n");
}
/*
This script can be used on Win32 systems
Expand All @@ -18,14 +17,14 @@

$cygwin_path = 'c:\cygwin\bin';

$path = getenv("PATH");
putenv("PATH=$cygwin_path;$path");
$path = getenv('PATH');
putenv("PATH={$cygwin_path};{$path}");

array_shift($argv);
system("sh ext_skel " . implode(" ", $argv));
system('sh ext_skel ' . implode(' ', $argv));

$extname = "";
$skel = "skeleton";
$extname = '';
$skel = 'skeleton';
foreach($argv as $arg) {
if (strtolower(substr($arg, 0, 9)) == "--extname") {
$extname = substr($arg, 10);
Expand Down
4 changes: 2 additions & 2 deletions win32/inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if (_WIN32_WINNT < 0x0600) /* Vista/2k8 have these functions */


PHPAPI int inet_pton(int af, const char* src, void* dst)
PHPAPI short int inet_pton(int af, const char* src, void* dst)
{
int address_length;
struct sockaddr_storage sa;
Expand Down Expand Up @@ -79,7 +79,7 @@ PHPAPI const char* inet_ntop(int af, const void* src, char* dst, size_t size)

#endif

int inet_aton(const char *cp, struct in_addr *inp) {
unsigned short int inet_aton(const char *cp, struct in_addr *inp) {
inp->s_addr = inet_addr(cp);

if (inp->s_addr == INADDR_NONE) {
Expand Down