diff --git a/gfx/video_shader_parse.h b/gfx/video_shader_parse.h index c1ecb1778b..30f50151c7 100644 --- a/gfx/video_shader_parse.h +++ b/gfx/video_shader_parse.h @@ -178,7 +178,7 @@ struct video_shader_pass char *vertex; /* Dynamically allocated. Must be free'd. */ char *fragment; /* Dynamically allocated. Must be free'd. */ } string; - char path[PATH_MAX_LENGTH]; + char path[NAME_MAX_LENGTH*2]; } source; char alias[64]; uint8_t flags; @@ -189,7 +189,7 @@ struct video_shader_lut unsigned filter; enum gfx_wrap_type wrap; char id[64]; - char path[PATH_MAX_LENGTH]; + char path[NAME_MAX_LENGTH*2]; bool mipmap; }; diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index 0ccc4e300a..24b18c938f 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -139,6 +139,14 @@ static INLINE bool bits_any_different(uint32_t *a, uint32_t *b, uint32_t count) #define DIR_MAX_LENGTH 256 #endif +/** + * An upper limit for the length of a file or directory (excluding parent directories). + * If a path has a component longer than this, it may not work properly. + */ +#ifndef NAME_MAX_LENGTH +#define NAME_MAX_LENGTH 128 +#endif + #else #ifndef PATH_MAX_LENGTH @@ -149,8 +157,6 @@ static INLINE bool bits_any_different(uint32_t *a, uint32_t *b, uint32_t count) #define DIR_MAX_LENGTH 1024 #endif -#endif - /** * An upper limit for the length of a file or directory (excluding parent directories). * If a path has a component longer than this, it may not work properly. @@ -159,6 +165,9 @@ static INLINE bool bits_any_different(uint32_t *a, uint32_t *b, uint32_t count) #define NAME_MAX_LENGTH 256 #endif +#endif + + #ifndef MAX /** * @return \c a or \c b, whichever is larger.