commit 80c8c31a52a7734771cb07c38a09429e7f53d54c parent e5f4d3351f7346cfc7d9f7dafb05eede6e280b94 Author: Michael Savage <mikejsavage@gmail.com> Date: Mon Aug 17 22:33:20 +0200 Warn on errors in load_game Diffstat:
main.cc | | | 8 | ++++++++ |
diff --git a/main.cc b/main.cc @@ -1,4 +1,5 @@ #include <stdio.h> +#include <err.h> #include <time.h> #include <dlfcn.h> #include <sys/stat.h> @@ -37,6 +38,8 @@ Game load_game( const char * const path ) { game.frame = ( GameFrame * ) dlsym( game.lib, "game_frame" ); if( !game.init || !game.frame ) { + warnx( "load_game: couldn't find game functions (init = %p, frame = %p)", game.init, game.frame ); + game.init = nullptr; game.frame = nullptr; } @@ -44,6 +47,11 @@ Game load_game( const char * const path ) { game.lib_write_time = file_last_write_time( path ); + const char * const error = dlerror(); + if( error ) { + warnx( "load_game: %s", error ); + } + return game; }