feat(CI): Windows MSVC and GCC build (#6015)

This commit is contained in:
Liam
2024-04-18 09:12:50 -04:00
committed by GitHub
parent d0436fbb59
commit e72f52d0bd
20 changed files with 269 additions and 92 deletions
+16 -10
View File
@@ -13,16 +13,23 @@
*********************/
#if LV_BUILD_TEST
#include "../lvgl.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <errno.h>
#include "unity.h"
#define PNG_DEBUG 3
#include <png.h>
#ifdef _WIN32
#include <direct.h>
#define mkdir(pathname, mode) _mkdir(pathname)
#define strtok_r strtok_s
#else
#include <sys/stat.h>
#endif
/*********************
* DEFINES
*********************/
@@ -429,21 +436,20 @@ static void create_folders_if_needed(const char * path)
char * token = strtok_r(pathCopy, "/", &ptr);
char current_path[1024] = {'\0'}; // Adjust the size as needed
struct stat st;
while(token && ptr && *ptr != '\0') {
strcat(current_path, token);
strcat(current_path, "/");
if(stat(current_path, &st) != 0) {
// Folder doesn't exist, create it
if(mkdir(current_path, 0777) != 0) {
perror("Error creating folder");
free(pathCopy);
exit(EXIT_FAILURE);
}
int mkdir_retval = mkdir(current_path, 0777);
if (mkdir_retval == 0) {
printf("Created folder: %s\n", current_path);
}
else if (errno != EEXIST) {
perror("Error creating folder");
free(pathCopy);
exit(EXIT_FAILURE);
}
token = strtok_r(NULL, "/", &ptr);
}