Skip to content
  • Niklas Haas's avatar
    libplacebo: use explicit checks instead of assert() · 59cb23b9
    Niklas Haas authored
    Since assert() can be compiled out, and users will vehemently argue for
    their right to do so, just explicitly check everything we absolutely
    100% want to crash on instead of blindly continuing.
    
    For convenience, a helper function is introduced for this (pl_assert),
    which is defined as assert in the common case (debugging builds), but
    otherwise gets compiled to an if () abort();
    
    This should prevent all serious cases of undefined behavior from
    occurring without requiring users to build debugging builds.
    59cb23b9