Porting Pigz to Windows: A Surprisingly Smooth Cross-Platform Journey

2025-06-23
Porting Pigz to Windows: A Surprisingly Smooth Cross-Platform Journey

Pigz, a Unix-style compression tool, was surprisingly easy to port to Windows. The article details the challenges encountered, such as differences in pthreads threading library and dirent functions, and minor variations in C library function names. The author cleverly utilized existing compatibility patches and the Premake build system to overcome these hurdles. Premake simplified the creation and maintenance of Visual Studio project files, ultimately resulting in a successful Pigz implementation on Windows.

Read more
Development

SumatraPDF Dev Ditches std::function After 16 Years, Rolls His Own

2025-06-15
SumatraPDF Dev Ditches std::function After 16 Years, Rolls His Own

After 16 years of C++ development on SumatraPDF, the author abandoned `std::function` and lambdas due to debugging difficulties. Crash reports were hard to decipher because of the auto-generated names of compiler-generated lambda functions. He created simpler, custom callback functions `Func0` and `Func1`. While less feature-rich than `std::function`, they offer significant advantages in memory footprint and compilation speed, and are easier to debug. This post details the design and implementation of `Func0` and `Func1`, and explains why this approach better suits SumatraPDF's needs.

Read more
Development callbacks