This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/blenlib
Julian Eisel 280dac323c Blenlib: Add BLI_assert_msg() for printing an extra string if the assert fails
It always bothered me that we'd do the `BLI_assert(... || !"message")` trick to
print a message alongside the assert, while it should be trivial to have a way
to pass an extra string as additional argument.

This adds `BLI_assert_msg()` with a second argument for a message. E.g.:
```
BLI_assert_msg(
    params->rename_id == NULL,
    "File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile.");
```

On failure this will print like this:
```
0   Blender                             0x00000001140647a3 BLI_system_backtrace + 291
[...]
13  Blender                             0x00000001092647a6 main + 3814
14  libdyld.dylib                       0x00007fff203d8f5d start + 1
BLI_assert failed: source/blender/editors/space_file/file_ops.c:2352, file_directory_new_exec(), at 'params->rename_id == ((void*)0)'
  File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile.
```

Reviewed by: Sybren Stüvel, Jacques Lucke, Sergey Sharybin, Campbell Barton

Differential Revision: https://developer.blender.org/D11827
2021-07-12 11:46:24 +02:00
..
2021-03-29 19:11:17 -06:00
2021-01-11 14:59:05 +01:00
2021-01-11 14:59:05 +01:00
2021-01-04 17:38:11 +11:00
2021-06-02 08:28:46 -04:00
2021-03-18 09:36:44 +11:00
2020-08-28 10:04:26 -06:00
2021-05-21 10:25:47 +05:30
2021-01-04 17:38:11 +11:00
2021-01-15 12:17:11 +11:00
2021-01-11 14:59:05 +01:00
2021-07-07 13:42:46 +10:00
2021-03-25 16:01:41 +01:00
2021-04-19 23:56:12 +10:00
2021-06-28 13:16:32 +02:00