ReneNyffenegger / cpp-base64

base64 encoding and decoding with c++
Other
891 stars 311 forks source link

Replace throw with assert if -fno-exceptions #36

Open GIldons opened 1 year ago

GIldons commented 1 year ago

On systems with exception disabled current code is not able to compile. Replace throw with assert in such systems.

jimemo commented 1 year ago

This problem exists when compiling in VSCode/PlatformIO. Workaround:

  1. Edit cpp-base64\base64.cpp, within function pos_of_char() Comment out: throw std::runtime_error("Input is not valid base64-encoded data."); Add: return 0;
  2. Delete cpp-base64\test.cpp and cpp-base64\test-google.cpp

Apart from that it works great.