diff --git a/include/cpj.h b/include/cpj.h index cf3fa33..ec7b104 100644 --- a/include/cpj.h +++ b/include/cpj.h @@ -5,6 +5,7 @@ #include #include +#include #if defined(_WIN32) || defined(__CYGWIN__) #define CPJ_EXPORT __declspec(dllexport) @@ -34,14 +35,15 @@ extern "C" typedef char cpj_char_t; typedef size_t cpj_size_t; +#define CPJ_SIZE_MAX SIZE_MAX /** * Description of a JerryScript string for arguments passing */ typedef struct { - const cpj_char_t - *ptr; /**< pointer to the zero-terminated ASCII/UTF-8/CESU-8 string */ + /**< pointer to the zero-terminated ASCII/UTF-8/CESU-8 string */ + const cpj_char_t *ptr; cpj_size_t size; /**< size of the string, excluding '\0' terminator */ } cpj_string_t; @@ -85,7 +87,7 @@ typedef enum } cpj_path_style_t; /** - * Helper to to ensure str is a string literal + * Helper to generate a string literal with type const cpj_char_t * */ #define CPJ_ZSTR_LITERAL(str) (const cpj_char_t *)(str "") @@ -94,7 +96,7 @@ typedef enum * pair. */ #define CPJ_ZSTR_ARG(str) \ - ((CPJ_ZSTR_LITERAL(str))), ((cpj_size_t)(sizeof(str) - 1)) + (CPJ_ZSTR_LITERAL(str)), ((cpj_size_t)(sizeof(str) - 1)) /** * @brief Generates an absolute path based on a base.