Repository navigation
CSV Parser 3.0.0: Single Thread + Emscripten Support
Highlights
Version 3.0.0 adds robust single-thread and Emscripten/WebAssembly support while keeping the familiar CSVReader API.
New in 3.0.0
Emscripten / WebAssembly
- Emscripten builds are supported in single-threaded mode.
- Memory-mapped parsing is disabled on Emscripten.
CSVReader("file.csv")continues to work and uses stream parsing internally.- Note: The CSV parser test suite is currently not run against the Emscripten target (only a compilation smoke test is performed). Currently, a WASM smoke test suite is being worked on.
Threading behavior
CSV_ENABLE_THREADS=0is forced on Emscripten.- On other platforms, threading defaults to enabled.
- For CMake users, threading is auto-disabled when thread libraries are unavailable.
- Public API remains unchanged; parsing runs synchronously when threading is off.
Build and portability updates
- Removed dependency on
CMAKE_CXX_STANDARDpreprocessor define in feature detection. - Improved portability around C++ version checks and compiler behavior.
Quality and correctness fixes
- Hardened stream size conversion checks.
- Resolved CodeQL warning in numeric exponent helper (
pow10). - Preserved and restored important concurrency design comments.
Upgrade Notes
No migration is required for existing users. Public APIs are unchanged.
If you want single-thread mode explicitly, use one of the options below.
For CMake users
- Optional: explicitly disable threading:
set(CSV_ENABLE_THREADS OFF)
add_subdirectory(csv-parser)- If threads are unavailable in your environment,
csv-parsernow disables threading automatically.
For non-CMake users
Define the macro before including csv-parser headers to force single-thread mode:
#define CSV_ENABLE_THREADS 0
#include "csv.hpp"Emscripten users
No special runtime API changes are required. Threading is disabled and filename parsing uses stream-backed logic automatically.
Notes on Performance
- Native builds still default to threaded + mmap-capable fast paths where available.
- WebAssembly and other threadless targets trade some throughput for broader compatibility and easier integration.
Thanks
Thank you to everyone reporting portability and compiler issues, especially around CMake standard detection and threadless environments. These reports directly shaped this release.
What's Changed
- Single Threaded + Emscripten Support by @vincentlaucsb in #301
Full Changelog: 2.5.2...3.0.0