Skip to content

Commit b9037f7

Browse files
author
Andi Gutmans
committed
- Make PHP compile again under Windows.
- Please be careful when you make such changes.
1 parent 0249137 commit b9037f7

File tree

6 files changed

+34
-33
lines changed

6 files changed

+34
-33
lines changed

ext/odbc/php_odbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ PHP_FUNCTION(odbc_fetch_into)
12271227
}
12281228
/* }}} */
12291229

1230-
#ifdef HAVE_SOLID || defined(HAVE_SOLID_35)
1230+
#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35)
12311231
PHP_FUNCTION(solid_fetch_prev)
12321232
{
12331233
odbc_result *result;

ext/standard/basic_functions.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
#include "php_globals.h"
5454
#include "SAPI.h"
5555

56-
5756
#ifdef ZTS
5857
int basic_globals_id;
5958
#else

ext/standard/file.c

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "php_globals.h"
2828
#include "ext/standard/flock_compat.h"
2929
#include "ext/standard/exec.h"
30+
#include "ext/standard/php_filestat.h"
3031

3132
#include <stdio.h>
3233
#include <stdlib.h>
@@ -1575,11 +1576,10 @@ PHP_FUNCTION(fpassthru)
15751576
zend_list_delete((*arg1)->value.lval);
15761577
RETURN_LONG(size);
15771578
}
1578-
15791579
/* }}} */
1580+
15801581
/* {{{ proto int rename(string old_name, string new_name)
15811582
Rename a file */
1582-
15831583
PHP_FUNCTION(rename)
15841584
{
15851585
pval **old_arg, **new_arg;
@@ -1609,8 +1609,38 @@ PHP_FUNCTION(rename)
16091609

16101610
RETVAL_TRUE;
16111611
}
1612+
/* }}} */
1613+
16121614

1615+
/* {{{ proto int unlink(string filename)
1616+
Delete a file */
1617+
PHP_FUNCTION(unlink)
1618+
{
1619+
pval **filename;
1620+
int ret;
1621+
PLS_FETCH();
1622+
1623+
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
1624+
WRONG_PARAM_COUNT;
1625+
}
1626+
convert_to_string_ex(filename);
1627+
1628+
if (PG(safe_mode) && !php_checkuid((*filename)->value.str.val, NULL, 2)) {
1629+
RETURN_FALSE;
1630+
}
1631+
1632+
ret = V_UNLINK((*filename)->value.str.val);
1633+
if (ret == -1) {
1634+
php_error(E_WARNING, "Unlink failed (%s)", strerror(errno));
1635+
RETURN_FALSE;
1636+
}
1637+
/* Clear stat cache */
1638+
PHP_FN(clearstatcache)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
1639+
RETURN_TRUE;
1640+
}
16131641
/* }}} */
1642+
1643+
16141644
/* {{{ proto int ftruncate (int fp, int size)
16151645
Truncate file to 'size' length */
16161646
PHP_FUNCTION(ftruncate)

ext/standard/file.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ PHP_FUNCTION(fpassthru);
6060
PHP_FUNCTION(readfile);
6161
PHP_FUNCTION(umask);
6262
PHP_FUNCTION(rename);
63+
PHP_FUNCTION(unlink);
6364
PHP_FUNCTION(copy);
6465
PHP_FUNCTION(file);
6566
PHP_FUNCTION(set_socket_blocking); /* deprecated */

ext/standard/link.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -158,37 +158,9 @@ PHP_FUNCTION(link)
158158
}
159159
/* }}} */
160160

161-
/* {{{ proto int unlink(string filename)
162-
Delete a file */
163-
PHP_FUNCTION(unlink)
164-
{
165-
pval **filename;
166-
int ret;
167-
PLS_FETCH();
168-
169-
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
170-
WRONG_PARAM_COUNT;
171-
}
172-
convert_to_string_ex(filename);
173-
174-
if (PG(safe_mode) && !php_checkuid((*filename)->value.str.val, NULL, 2)) {
175-
RETURN_FALSE;
176-
}
177-
178-
ret = V_UNLINK((*filename)->value.str.val);
179-
if (ret == -1) {
180-
php_error(E_WARNING, "Unlink failed (%s)", strerror(errno));
181-
RETURN_FALSE;
182-
}
183-
/* Clear stat cache */
184-
PHP_FN(clearstatcache)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
185-
RETURN_TRUE;
186-
}
187-
/* }}} */
188161

189162
#endif
190163

191-
192164
/*
193165
* Local variables:
194166
* tab-width: 4

ext/standard/php_link.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#ifdef HAVE_SYMLINK
3636

3737
PHP_FUNCTION(link);
38-
PHP_FUNCTION(unlink);
3938
PHP_FUNCTION(readlink);
4039
PHP_FUNCTION(linkinfo);
4140
PHP_FUNCTION(symlink);

0 commit comments

Comments
 (0)