Skip to content

I/O issues in mingw due to _MSC_VER misuse #1105

@letmaik

Description

@letmaik

The following conditionals are essential on Windows, however since _MSC_VER is used instead of _WIN32 this will break on gcc within mingw64. It would be good if these could be fixed. By the way, I saw you use Appveyor but don't run any tests, just compile it. And you already make use of MSYS's cmake within Appveyor. Why not extend it for building under mingw and running tests there?

#ifdef _MSC_VER
tempdir = getenv("TEMP");
#else
tempdir = "/tmp";
#endif

netcdf-c/libdispatch/dfile.c

Lines 2522 to 2526 in c844e5b

#ifdef _MSC_VER
file->fp = fopen(file->path, "rb");
#else
file->fp = fopen(file->path, "r");
#endif

#ifdef _MSC_VER
stream = NCfopen(filename,"rb");
#else
stream = NCfopen(filename,"r");
#endif

#ifdef _MSC_VER
fd=NCopen3(tmp,O_RDWR|O_BINARY|O_CREAT, _S_IREAD|_S_IWRITE);
#else
fd=NCopen3(tmp,O_RDWR|O_CREAT|O_EXCL, S_IRWXU);
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions