php-src/win32
Calvin Buckley 76791e90b9
Use win32 glob implementation on all platforms (#18164)
* Move glob to main/ from win32/

In preparation to make the Win32 reimplementation the standard
cross-platform one. Currently, it doesn't do that and just passes
through the original glob implementation. We could consider also having
an option to use the standard glob for systems that have a sufficient
one.

* Enable building with win32 glob on non-windows

Kind of broken. We're namespacing the function and struct, but not yet
the GLOB_* defines. There are a lot of places callers check if i.e.
NOMATCH is defined that would likely become redundant.

Currently it also has php_glob and #defines glob php_glob (etc.) - I
suspect doing the opposite and changing the callers would make more
sense, just doing MVP to geet it to build (even if it fails tests).

* Massive first pass at conversion to internal glob

Have not tested yet. the big things are:

- Should be invisible to userland PHP code.
- A lot of :%s/GLOB_/PHP_GLOB_/g; the diff can be noisy as a result,
  especially in comments.
- Prefixes everything with PHP_ to avoid conflicts with system glob in
  case it gets included transitively.
- A lot of weird shared definitions that were sprawled out to other
  headers are now included in php_glob.h.
- A lot of (but not yet all cases) of HAVE_GLOB are removed, since we
  can always fall back to php_glob.
- Using the system glob is not wired up yet; it'll need more shim
  ifdefs for each flag type than just glob_t/glob/globfree defs.

* Fix inclusion of GLOB_ONLYDIR

This is a GNU extension, but we don't need to implement it, as the GNU
implementation is flawed enough that callers have to manually filter it
anyways; just provide a stub definition for the constant.

We could consideer implementing this properly later. For now, fixes the
basic glob constant tests.

* Remove HAVE_GLOBs

We now always have a glob implementation that works. HAVE_GLOB should
only be used to check if we have a system implementation, for if we
decide to wrap the system implementation instead.

* We don't need to care about being POSIXly correct for internal glob

* Check for reallocarray

Ideally temporary until GH-17433.

* Forgot to move this file from win32/ to main/

* Check for issetugid (BSD function)

* Allow using the system glob with --enable-system-glob

* Style fix after removing ifdef

* Remove empty case for system glob
2025-05-20 16:20:59 -03:00
..
build Use win32 glob implementation on all platforms (#18164) 2025-05-20 16:20:59 -03:00
codepage.c Replace __forceinline with zend_always_inline in win32/ (GH-17482) 2025-01-16 15:05:24 +01:00
codepage.h Replace __forceinline with zend_always_inline in win32/ (GH-17482) 2025-01-16 15:05:24 +01:00
console.c Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
console.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
cp_enc_map.c Trailing whitespaces 2018-01-03 14:38:00 +01:00
cp_enc_map_gen.c Remove local variables 2019-02-03 21:03:00 +01:00
dllmain.c win32/dllmain.c: drop some unused code (#16353) 2024-10-13 11:24:22 +01:00
fnmatch.c Fix Clang style nits (GH-17685) 2025-02-05 14:13:56 +01:00
fnmatch.h Remove local variables 2019-02-03 21:03:00 +01:00
ftok.c Avoid undefined behavior in Windows ftok(3) emulation 2022-11-18 14:37:00 +01:00
getrusage.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
getrusage.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
globals.c Fix missing include in win32/globals.c 2025-05-06 15:51:37 +02:00
ioutil.c Solve C4267 warnings in win32/ioutil for x64 (GH-17674) 2025-02-03 00:13:58 +01:00
ioutil.h Solve C4267 warnings in win32/ioutil for x64 (GH-17674) 2025-02-03 00:13:58 +01:00
ipc.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
nice.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
nice.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
param.h Remove local variables 2019-02-03 21:03:00 +01:00
php_registry.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
php_win32_globals.h Autotools: Refactor thread safety checks (#15214) 2024-08-05 22:30:10 +02:00
readdir.c Fix Clang style nits (GH-17685) 2025-02-05 14:13:56 +01:00
readdir.h Cache d_type in directory entry 2023-07-07 18:02:32 +02:00
registry.c Address more Clang warnings (GH-17506) 2025-01-21 20:05:29 +01:00
select.c Improve fix for GH-16889 2024-12-16 23:25:38 +01:00
select.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
sendmail.c Don't forward declare static functions in sendmail.h (GH-17684) 2025-02-03 16:50:32 +01:00
sendmail.h Don't forward declare static functions in sendmail.h (GH-17684) 2025-02-03 16:50:32 +01:00
signal.c Merge branch 'PHP-8.3' into PHP-8.4 2025-05-05 19:14:13 +02:00
signal.h Fix leak+crash with sapi_windows_set_ctrl_handler() 2025-05-05 19:13:39 +02:00
sockets.c Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
sockets.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
syslog.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
time.c Voidify getfilesystemtime() (GH-15413) 2024-08-14 21:09:26 +02:00
time.h Remove support for unsupported MSVC versions (GH-17128) 2024-12-12 19:50:14 +01:00
unistd.h Remove local variables 2019-02-03 21:03:00 +01:00
winutil.c Fix Clang style nits (GH-17685) 2025-02-05 14:13:56 +01:00
winutil.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
wsyslog.c Address more Clang warnings (GH-17506) 2025-01-21 20:05:29 +01:00