sisong / HDiffPatch

a C\C++ library and command-line tools for Diff & Patch between binary files or directories(folder); cross-platform; runs fast; create small delta/differential; support large files and limit memory requires when diff & patch.
Other
1.52k stars 280 forks source link

Make it possible to compile the library without using C++ exceptions #354

Closed JohnAlcatraz closed 1 year ago

JohnAlcatraz commented 1 year ago

I would like to use this library in a project that is compiled with -fno-exceptions. Unfortunately this library cannot be compiled in such a project at the moment, since this library uses try/catch/throw and there does not appear to be any #define to disable the exceptions globally for this library.

sisong commented 1 year ago

all patch code only used C, but diff code used C++ & used exceptions

JohnAlcatraz commented 1 year ago

Could you add a #define NO_EXCEPTIONS that disables the exceptions in the diff code, so that it can be compiled successfully with -fno-exceptions?

sisong commented 1 year ago

That require too many code changes