fix: make C tests work again

This commit is contained in:
Gabor Kiss-Vamosi
2022-07-19 17:37:36 +02:00
parent 6104855491
commit 965552e446
4 changed files with 14 additions and 46 deletions

View File

@@ -14,7 +14,6 @@
#ifndef WIN32
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
#else
#include <windows.h>
#endif
@@ -118,17 +117,7 @@ static void * fs_open(lv_fs_drv_t * drv, const char * path, lv_fs_mode_t mode)
char buf[MAX_PATH_LEN];
lv_snprintf(buf, sizeof(buf), LV_FS_STDIO_PATH "%s", path);
void * a = fopen(buf, flags);
printf("%s\n", path);
printf("%d\n", errno);
char buf2[512];
getcwd(buf2, 512);
printf("%s\n", buf2);
printf("%p\n", a);
return a;
return fopen(buf, flags);
}
/**

View File

@@ -68,38 +68,8 @@ typedef struct {
int lv_snprintf_builtin(char * buffer, size_t count, const char * format, ...);
int lv_vsnprintf_builtin(char * buffer, size_t count, const char * format, va_list va);
/**
* Tiny snprintf/vsnprintf implementation
* \param buffer A pointer to the buffer where to store the formatted string
* \param count The maximum number of characters to store in the buffer, including a terminating null character
* \param format A string that specifies the format of the output
* \param va A value identifying a variable arguments list
* \return The number of characters that COULD have been written into the buffer, not counting the terminating
* null character. A value equal or larger than count indicates truncation. Only when the returned value
* is non-negative and less than count, the string has been completely written.
*/
LV_FORMAT_ATTRIBUTE(3, 4) static inline int lv_snprintf(char * buffer, size_t count, const char * format, ...)
{
/* Declare a va_list type variable */
va_list args;
/* Initialise the va_list variable with the ... after fmt */
va_start(args, format);
/* Forward the '...' to vprintf */
int ret = LV_SNPRINTF(buffer, count, format, args);
/* Clean up the va_list */
va_end(args);
return ret;
}
LV_FORMAT_ATTRIBUTE(3, 0) static inline int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va)
{
return LV_VSNPRINTF(buffer, count, format, va);
}
#define lv_snprintf LV_SNPRINTF
#define lv_vsnprintf LV_VSNPRINTF
#ifdef __cplusplus