Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform compatibility with MinGW and HPE NonStop #99

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clar.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include <sys/stat.h>

#ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <io.h>
# include <shellapi.h>
# include <direct.h>

# define _MAIN_CC __cdecl
Expand Down Expand Up @@ -68,7 +68,7 @@
# define PRIxZ "Ix"
# endif

# if defined(_MSC_VER) || defined(__MINGW32__)
# if defined(_MSC_VER) || (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR))
typedef struct stat STAT_T;
# else
typedef struct _stat STAT_T;
Expand Down
2 changes: 2 additions & 0 deletions clar/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ cl_fs_cleanup(void)
{
#ifdef CLAR_FIXTURE_PATH
fs_rm(fixture_path(_clar_path, "*"));
#else
((void)fs_copy); /* unused */
#endif
}

Expand Down
6 changes: 6 additions & 0 deletions clar/sandbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ static int build_sandbox_path(void)
if (_mktemp_s(_clar_path, sizeof(_clar_path)) != 0)
return -1;

if (mkdir(_clar_path, 0700) != 0)
return -1;
#elif defined(__TANDEM)
if (mktemp(_clar_path) == NULL)
return -1;

if (mkdir(_clar_path, 0700) != 0)
return -1;
#else
Expand Down
Loading