diff options
author | Thomas Herzog <karroffel@users.noreply.github.com> | 2017-05-10 07:38:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-10 07:38:40 +0200 |
commit | 6d0568d8179f7dcca54b1c87ab199820a468ef2c (patch) | |
tree | ba96df330177f0025175a66c28dc51492be01c72 /modules | |
parent | 32afcbc48258ea970ef4b0707f69543baf0f2f5a (diff) | |
parent | 99e07448d1bb67f4b10e2234b5f2f18a0acf5de2 (diff) |
Merge pull request #8704 from sheepandshepherd/gdnative_error_printing
Add error printing functions to GDNative
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/godot.cpp | 9 | ||||
-rw-r--r-- | modules/gdnative/godot.h | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/modules/gdnative/godot.cpp b/modules/gdnative/godot.cpp index 7477a28db6..4b865966fd 100644 --- a/modules/gdnative/godot.cpp +++ b/modules/gdnative/godot.cpp @@ -30,6 +30,7 @@ #include "godot.h" #include "class_db.h" +#include "error_macros.h" #include "gdnative.h" #include "global_config.h" #include "global_constants.h" @@ -215,6 +216,14 @@ void GDAPI godot_free(void *p_ptr) { memfree(p_ptr); } +void GDAPI godot_print_error(const char *p_description, const char *p_function, const char *p_file, int p_line) { + _err_print_error(p_function, p_file, p_line, p_description, ERR_HANDLER_ERROR); +} + +void GDAPI godot_print_warning(const char *p_description, const char *p_function, const char *p_file, int p_line) { + _err_print_error(p_function, p_file, p_line, p_description, ERR_HANDLER_WARNING); +} + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/godot.h b/modules/gdnative/godot.h index b05cafbe50..e8f0bc0553 100644 --- a/modules/gdnative/godot.h +++ b/modules/gdnative/godot.h @@ -404,6 +404,10 @@ void GDAPI *godot_alloc(int p_bytes); void GDAPI *godot_realloc(void *p_ptr, int p_bytes); void GDAPI godot_free(void *p_ptr); +//print using Godot's error handler list +void GDAPI godot_print_error(const char *p_description, const char *p_function, const char *p_file, int p_line); +void GDAPI godot_print_warning(const char *p_description, const char *p_function, const char *p_file, int p_line); + #ifdef __cplusplus } #endif |