- Add test target to both bmake.mk and gmake.mk Makefiles
- Add test-related artifacts to .gitignore (excluding DLLs/shared libs)
- Create test directory with cross-platform Makefiles (bmake.mk, gmake.mk)
- Implement cross-platform test program with signal handling (test.c)
- Add test module source for compilation (test_mod.c)
- Set up automated test environment with mods/ directory
- Support both POSIX and Windows platforms
The test infrastructure allows running integration tests via 'make test'
and demonstrates stk library functionality with dynamic module loading.
Generated DLLs/shared libraries are excluded from version control.
Refactor memory allocation patterns:
- Replace realloc-in-loop with count-then-allocate pattern across all platforms
- Eliminate arbitrary buffer sizes (e.g., malloc(8 * ...)) in favor of exact counts
- Reduce allocation overhead by pre-counting items before malloc
Fix Windows file watching:
- Replace unreliable FindFirstChangeNotification with directory handle approach
- Add is_file_ready() to prevent events while compiler is still writing files
- Preserve timestamps when file is locked to retry on next poll
- Fix do-while loop in platform_directory_init_scan (was skipping first file)
Fix Linux inotify event handling:
- Consolidate DELETE+CREATE pairs into single RELOAD event
- Prevents duplicate events when compiler uses temp-file-and-rename pattern
Fix BSD/macOS kqueue implementation:
- Remove realloc loops from update_watches() and watch initialization
- Pre-count files before allocating file descriptor arrays
All platforms now correctly handle:
- Compiler overwrites (temp file operations)
- Manual copy/move operations
- Explicit file deletions
Tested on Linux, Windows 10, and FreeBSD.
- Split Makefile into gmake.mk (Linux/Windows) and bmake.mk (BSD/macOS)
- Added config.mk for shared variables.
- Added build.sh and build.bat dispatchers.
- Retains old build behavior with dependency tracking.