From: Brian Paul Date: Tue, 30 Mar 2010 19:36:10 +0000 (-0600) Subject: util: added util_dl_error() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3258058d3b3fe0412007bfa699918bbe1665939d;p=mesa.git util: added util_dl_error() --- diff --git a/src/gallium/auxiliary/util/u_dl.c b/src/gallium/auxiliary/util/u_dl.c index 37ed789f955..220860ebf4b 100644 --- a/src/gallium/auxiliary/util/u_dl.c +++ b/src/gallium/auxiliary/util/u_dl.c @@ -78,3 +78,16 @@ util_dl_close(struct util_dl_library *library) (void)library; #endif } + + +const char * +util_dl_error(void) +{ +#if defined(PIPE_OS_UNIX) + return dlerror(); +#elif defined(PIPE_OS_WINDOWS) + return "unknown error"; +#else + return "unknown error"; +#endif +} diff --git a/src/gallium/auxiliary/util/u_dl.h b/src/gallium/auxiliary/util/u_dl.h index 85296c58af6..2853b447c61 100644 --- a/src/gallium/auxiliary/util/u_dl.h +++ b/src/gallium/auxiliary/util/u_dl.h @@ -70,4 +70,11 @@ void util_dl_close(struct util_dl_library *library); +/** + * Return most recent error message. + */ +const char * +util_dl_error(void); + + #endif /* U_DL_H_ */