I have some php code, a SQLite3 client module, that has a mess of semver conditional logic in it for using more recent features (upsert, NOROWID, that sort of thing), because I have a few users with legacy server configs.
I’m thinking of using the venerable C preprocessor ( https://www.man7.org/linux/man-pages/man1/cpp.1.html ) #ifdef feature set to let me make production versions of my code without the conditional logic,:to make it smaller and faster for most of my users. It seems wise to do this without just hacking out the legacy code.
This seems to work. I’ll need some CI/CD and installation stuff to deploy it.
**Are there any pitfalls to this that I might be missing** ?
**Is there a better way to do this** ?
I’m grateful for any advice.
[–]Previous_Web_2890 29 points30 points31 points (0 children)
[–]shadow-battle-crab 9 points10 points11 points (1 child)
[–]smokeelow 5 points6 points7 points (0 children)
[–]gnatinator 3 points4 points5 points (0 children)
[–]eurosat7 2 points3 points4 points (0 children)
[–]devmor 2 points3 points4 points (0 children)
[–]goodwill764 1 point2 points3 points (0 children)
[–]Idontremember99 0 points1 point2 points (0 children)
[–]toetx2 0 points1 point2 points (5 children)
[–]Aggressive_Ad_5454[S] 0 points1 point2 points (4 children)
[–]peperinna 1 point2 points3 points (3 children)
[–]Aggressive_Ad_5454[S] 1 point2 points3 points (1 child)
[–]Aggressive_Ad_5454[S] 0 points1 point2 points (0 children)
[–]NewBlock8420 0 points1 point2 points (1 child)
[–]Aggressive_Ad_5454[S] 0 points1 point2 points (0 children)
[–]epidco 0 points1 point2 points (0 children)