-
Notifications
You must be signed in to change notification settings - Fork 1
Add Windows support #2
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Windows build support for the crc_fast PHP extension by implementing a config.w32 build configuration file and making necessary C++ compatibility adjustments. The extension can now be built on Windows using the PHP SDK binary tools and Visual Studio toolchain.
Key changes:
- Created config.w32 for Windows build configuration with library detection and compiler/linker setup
- Added C++ extern "C" linkage guards to php_crc_fast.h for proper C/C++ interoperability
- Updated php_crc_fast.cpp to handle Windows platform differences (htonll/ntohll definitions)
- Added comprehensive build documentation for Windows developers
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| config.w32 | Implements Windows build configuration with library path detection, compiler flags, and linker settings |
| php_crc_fast.h | Adds C++ extern "C" linkage guards around PHP includes and module entry declaration |
| php_crc_fast.cpp | Adds Windows platform checks for htonll/ntohll definitions and extern "C" guards for module exports |
| .kiro/steering/build-commands.md | Documents the Windows build environment setup and build commands |
| .kiro/specs/windows-build-support/*.md | Provides requirements, design, and implementation tasks for Windows build support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $ | ||
| ``` | ||
|
|
||
| Build commands *CANNOT* work unless they're within this environment. If you find yourself outside of the environment for some reason, or the remaining build commands don't seem to be working properly, double-check that you're in the `php-sdk-binar-tools` environment, and if not, start it again. |
Copilot
AI
Nov 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'php-sdk-binar-tools' to 'php-sdk-binary-tools'.
| Build commands *CANNOT* work unless they're within this environment. If you find yourself outside of the environment for some reason, or the remaining build commands don't seem to be working properly, double-check that you're in the `php-sdk-binar-tools` environment, and if not, start it again. | |
| Build commands *CANNOT* work unless they're within this environment. If you find yourself outside of the environment for some reason, or the remaining build commands don't seem to be working properly, double-check that you're in the `php-sdk-binary-tools` environment, and if not, start it again. |
| "C:\\tools\\crc_fast" | ||
| ]; | ||
|
|
||
| // Add Scoop path if USERPROFILE is set |
Copilot
AI
Nov 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WshShell is referenced but never declared. This variable needs to be instantiated before use with var WshShell = WScript.CreateObject('WScript.Shell'); or similar initialization.
| // Add Scoop path if USERPROFILE is set | |
| // Add Scoop path if USERPROFILE is set | |
| var WshShell = WScript.CreateObject('WScript.Shell'); |
| "C:\\vcpkg\\installed\\x64-windows", | ||
| "C:\\vcpkg\\installed\\x86-windows", |
Copilot
AI
Nov 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard_paths array includes vcpkg paths, but the error message at lines 86-87 only lists x64-windows and x86-windows. Consider also checking for crc-fast and crc_fast subdirectories within these vcpkg paths, similar to how Program Files paths include both variants, since vcpkg typically installs packages in subdirectories.
The Problem
Some people run PHP on Windows, but this extension doesn't support it.
The Solution
Add support for building on Windows.
Planned version bump
MINORNotes
Does not yet auto-build and publish the Windows DLLs, but that's planned.