Skip to content

Commit

Permalink
Merge pull request #99 from pks-t/pks-platform-compatibility
Browse files Browse the repository at this point in the history
Platform compatibility with MinGW and HPE NonStop
  • Loading branch information
ethomson authored Sep 5, 2024
2 parents 1516124 + b35ae61 commit 614d38d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
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

0 comments on commit 614d38d

Please sign in to comment.