diff options
| author | John "Lameguy" Wilbert Villamor <lameguy64@gmail.com> | 2022-03-25 09:22:20 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-25 09:22:20 +0800 |
| commit | 975e614b3c840e2f717adac1d1cb9cee4e5e561b (patch) | |
| tree | 6584ce5b0dbe27a466c95c81fac61b0d90f627bd /libpsn00b/include/assert.h | |
| parent | 05d44488bd5587786f4bd0286fc0f555c79aa46a (diff) | |
| parent | 45168ae43e29aa5930ee5a206475ae836078915f (diff) | |
| download | psn00bsdk-975e614b3c840e2f717adac1d1cb9cee4e5e561b.tar.gz | |
Merge pull request #46 from spicyjpeg/psxmdec
Critical ldscript fixes, initial MDEC support and CI updates
Diffstat (limited to 'libpsn00b/include/assert.h')
| -rw-r--r-- | libpsn00b/include/assert.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/libpsn00b/include/assert.h b/libpsn00b/include/assert.h index 3114b57..e27f2ed 100644 --- a/libpsn00b/include/assert.h +++ b/libpsn00b/include/assert.h @@ -1,6 +1,20 @@ -#ifndef _ASSERT_H -#define _ASSERT_H +/* + * PSn00bSDK assert macro + * (C) 2022 spicyjpeg - MPL licensed + */ -void assert(int e); +#ifndef __ASSERT_H +#define __ASSERT_H -#endif
\ No newline at end of file +void _assert_abort(const char *file, int line, const char *expr); + +#ifdef DEBUG +#define assert(expr) { \ + if (!(expr)) \ + _assert_abort(__FILE__, __LINE__, #expr); \ +} +#else +#define assert(x) +#endif + +#endif |
