Reorganise src directory

This commit is contained in:
Abdelrahman Said 2024-10-06 12:54:04 +01:00
parent e9451f10f8
commit a48002996e
20 changed files with 7 additions and 6 deletions

@ -1,13 +1,16 @@
#include "cpath.h"
#include "aliases.h"
#include "platform.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#if defined(__unix__) || defined(__APPLE__) || defined(__ANDROID__)
#ifdef WAPP_PLATFORM_POSIX
internal char path_sep = '/';
#elif defined(_WIN32) || defined(_WIN64)
#elif defined(WAPP_PLATFORM_WINDOWS)
internal char path_sep = '\\';
#else
#error "Unrecognised platform"
#endif
void join_root_and_leaf(const char *root, const char *leaf, char *dst);

@ -7,11 +7,9 @@
BEGIN_C_LINKAGE
#endif // __cplusplus
#define NUMPARTS(...) \
(sizeof((const char *[]){"", __VA_ARGS__}) / sizeof(const char *) - 1)
#define NUMPARTS(...) (sizeof((const char *[]){"", __VA_ARGS__}) / sizeof(const char *) - 1)
#define wapp_cpath_join_path(DST, ...) \
join_path(DST, NUMPARTS(__VA_ARGS__), __VA_ARGS__)
#define wapp_cpath_join_path(DST, ...) join_path(DST, NUMPARTS(__VA_ARGS__), __VA_ARGS__)
#define wapp_cpath_dirname(DST, PATH) dirup(DST, 1, PATH)
#define wapp_cpath_dirup(DST, COUNT, PATH) dirup(DST, COUNT, PATH)