Function provides platform agnostic way to create a directory. This will be used by the binary shader cache.
Signed-off-by: Tapani Pälli <tapani.pa...@intel.com> --- src/mesa/main/imports.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index af780b2..db588a7 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -465,6 +465,24 @@ _mesa_little_endian(void) return *((const GLubyte *) &ui); } +#include <sys/stat.h> +#include <sys/types.h> +#include <errno.h> + +static inline int +_mesa_mkdir(const char *path) +{ +#ifdef _WIN32 + if (_mkdir(path) != 0) + return errno; + return 0; +#else + if (mkdir(path, 0775) != 0) + return errno; + return 0; +#endif +} + /********************************************************************** -- 1.8.3.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev