Add Windows platform support with complete abstraction layer#122
Closed
Copilot wants to merge 244 commits into
Closed
Add Windows platform support with complete abstraction layer#122Copilot wants to merge 244 commits into
Copilot wants to merge 244 commits into
Conversation
1. perfect reconnect logic 2. restructure network structure
fix mqtt qos2 bug
and other minor changes
…lude on Windows Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Copilot
AI
changed the title
Add Windows platform support with native Win32 APIs
Add compile-time platform detection to salof logging system
Feb 11, 2026
Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Copilot
AI
changed the title
Add compile-time platform detection to salof logging system
Fix system header includes in salof_defconfig.h
Feb 11, 2026
…tection Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Copilot
AI
changed the title
Fix system header includes in salof_defconfig.h
Add Windows platform support for mqttclient
Feb 11, 2026
…form handling Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Copilot
AI
changed the title
Add Windows platform support for mqttclient
Add Windows platform support with complete abstraction layer
Feb 11, 2026
…orm detection Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
1471619 to
20175e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The mqttclient library had no Windows platform adaptation layer. All platform-specific code (threading, mutexes, sockets, timers) was Linux-only with pthread dependencies.
Platform Abstraction Layer
Created
platform/windows/with Win32 API implementations:CRITICAL_SECTIONCreateThreadwith event-based lifecycleQueryPerformanceCounterfor microsecond precisionAutomatic Platform Detection
Fixed critical constant definition order bug:
The platform constants (
SALOF_USING_WINDOWS, etc.) were defined insalof_defconfig.hafter includingsalof_config.h, but the detection code insalof_config.hneeded those constants. This caused all Windows builds to be misdetected as Linux.Implemented three-layer detection:
salof_config.h: Primary detection via_WIN32,__linux__, etc.mqtt_config.h: Fallback with#ifndefguard to prevent redefinitionsalof_defconfig.h: Final safety check with error on unknown platformBuild System Updates
/W3 /O2vs GCC-Wall -O3).libon Windows vs.aon Linux)Windows-Specific Issues Fixed
Winsock conflicts: Added
WIN32_LEAN_AND_MEANand_WINSOCKAPI_guards to ensurewinsock2.htakes precedence over oldwinsock.hTLS disabled: mbedtls compilation on Windows has extensive issues. Disabled TLS entirely on Windows (TCP-only mode).
Cross-platform examples: All examples now use conditional compilation:
Testing
Linux builds verified - no regressions. Windows builds require user testing in actual Windows environment.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.