php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22021 php_scandir.c will not compile
Submitted: 2003-02-02 16:56 UTC Modified: 2003-02-02 17:09 UTC
From: dwkoehler at comcast dot net Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4CVS-2003-02-02 (stable) OS: Solaris 2.7
Private report: No CVE-ID: None
 [2003-02-02 16:56 UTC] dwkoehler at comcast dot net
The HAVE_DIRENT_H and PHP_WIN32 define blocks are reversed in php_scandir.h, included below.  As shown, GCC compilation will fail at line 15, blocking the compilation of php_scandir.c.  This is because HAVE_DIRENT_H is not defined at the shown line 3, therefore dirent.h does not include.  It is the php_config.h include which contains the HAVE_DIRENT_H define.

#include <sys/types.h>

#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif

#ifdef PHP_WIN32
#include "config.w32.h"
#include "win32/readdir.h"
#else
#include "php_config.h"
#endif

#ifndef HAVE_ALPHASORT
int alphasort(const struct dirent **a, const struct dirent **b);
#endif

#ifndef HAVE_SCANDIR
int scandir(const char *dirname,
	    struct dirent **namelist[],
	    int (*selector)(const struct dirent *entry),
	    int (*compare)(const struct dirent **a,const struct dirent **b) );
#endif

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-02 17:09 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 16 11:00:03 2025 UTC