BLI_path_util: Add string versions of SEP, ALTSEP

This allows for adding separators in string literals.
This commit is contained in:
Campbell Barton 2017-03-24 05:23:03 +11:00
parent 9af6f40e4d
commit 05b7591c62
1 changed files with 12 additions and 8 deletions

View File

@ -39,14 +39,6 @@ extern "C" {
struct ListBase;
#ifdef WIN32
#define SEP '\\'
#define ALTSEP '/'
#else
#define SEP '/'
#define ALTSEP '\\'
#endif
void BLI_setenv(const char *env, const char *val) ATTR_NONNULL(1);
void BLI_setenv_if_new(const char *env, const char *val) ATTR_NONNULL(1);
@ -145,6 +137,18 @@ bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char
# define FILE_MAX 1024
#endif
#ifdef WIN32
# define SEP '\\'
# define ALTSEP '/'
# define SEP_STR "\\"
# define ALTSEP_STR "/"
#else
# define SEP '/'
# define ALTSEP '\\'
# define SEP_STR "/"
# define ALTSEP_STR "\\"
#endif
/* Parent and current dir helpers. */
#define FILENAME_PARENT ".."
#define FILENAME_CURRENT "."