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

Add consistency in WIN32 define checks #384

Merged
merged 1 commit into from
Jul 29, 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
2 changes: 1 addition & 1 deletion src/silo/silo_win32_compatibility.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef WIN32
#ifdef _WIN32
#ifndef SILO_WIN32_COMPATIBILITY
#define SILO_WIN32_COMPATIBILITY
#include <io.h> /* Include Windows IO */
Expand Down
2 changes: 1 addition & 1 deletion tests/TestReadMask.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ product endorsement purposes.
*/
#include <stdio.h>
#include <silo.h>
#ifndef WIN32
#ifndef _WIN32
#include <sys/time.h>
#else
#include <string.h>
Expand Down
6 changes: 3 additions & 3 deletions tests/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ herein do not necessarily state or reflect those of the United States
Government or Lawrence Livermore National Security, LLC, and shall not
be used for advertising or product endorsement purposes.
*/
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#else
#include <direct.h>
Expand Down Expand Up @@ -298,7 +298,7 @@ int main(int argc, char *argv[])
/* test attempt to DBCreate a file without clobbering it and
for which the path is really a dir in the host filesystem */
unlink("dir-test-foo");
#ifndef WIN32
#ifndef _WIN32
mkdir("dir-test-foo", 0777);
#else
mkdir("dir-test-foo");
Expand All @@ -307,7 +307,7 @@ int main(int argc, char *argv[])
unlink("dir-test-foo");
if (dbfile2 != 0)
exit(EXIT_FAILURE);
#ifndef WIN32
#ifndef _WIN32
mkdir("dir-test-foo", 0777);
#else
mkdir("dir-test-foo");
Expand Down
2 changes: 1 addition & 1 deletion tests/grab.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ be used for advertising or product endorsement purposes.
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef WIN32
#ifndef _WIN32
#include <sys/time.h>
#include <unistd.h>
#endif
Expand Down
4 changes: 2 additions & 2 deletions tests/largefile.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ be used for advertising or product endorsement purposes.

#include "silo.h" /*include public silo */

#ifdef WIN32
#ifdef _WIN32
#include <stdlib.h>
#endif
#include <math.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions tests/largefile_netcdf.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <netcdf.h>
#include <stdio.h>

#ifdef WIN32
#ifdef _WIN32
#include <stdlib.h>
#endif
#include <math.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#endif

Expand Down
10 changes: 5 additions & 5 deletions tests/merge_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ product endorsement purposes.
#include <silo.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifndef WIN32
#ifndef _WIN32
#include <dirent.h>
#include <unistd.h>
#else
Expand Down Expand Up @@ -713,7 +713,7 @@ GetFileList (char *baseName, char ***filesOut, int *nFilesOut)
int nFileMax;
char **files=NULL;

#ifndef WIN32
#ifndef _WIN32
DIR *dirp=NULL;
struct dirent *dp=NULL;
#else
Expand All @@ -727,7 +727,7 @@ GetFileList (char *baseName, char ***filesOut, int *nFilesOut)
/*
* Open the directory.
*/
#ifndef WIN32
#ifndef _WIN32
dirp = opendir (".");
if (dirp == NULL) {
printf ("Error opening current directory\n");
Expand All @@ -754,7 +754,7 @@ GetFileList (char *baseName, char ***filesOut, int *nFilesOut)
nFiles = 0;
nFileMax = 128;
files = ALLOC_N (char *, nFileMax);
#ifndef WIN32
#ifndef _WIN32
for (dp = readdir (dirp); dp != NULL; dp = readdir (dirp))
{
char *fName = dp->d_name;
Expand Down Expand Up @@ -790,7 +790,7 @@ GetFileList (char *baseName, char ***filesOut, int *nFilesOut)
/*
* Close the directory.
*/
#ifndef WIN32
#ifndef _WIN32
closedir (dirp);
#else
FindClose(dirHandle);
Expand Down
2 changes: 1 addition & 1 deletion tests/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ be used for advertising or product endorsement purposes.
#include <hdf5.h>
#endif

#ifdef WIN32
#ifdef _WIN32
#include <string.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion tests/multi_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ product endorsement purposes.
#include <sys/stat.h>
#include <sys/types.h>

#ifdef WIN32
#ifdef _WIN32
# include <direct.h>
#else
# include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_file_memfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ product endorsement purposes.
#include <sys/stat.h>
#include <sys/types.h>

#ifdef WIN32
#ifdef _WIN32
# include <direct.h>
#else
# include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion tests/obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ be used for advertising or product endorsement purposes.
#include "silo.h"
#include <math.h>
#include <stdlib.h>
#ifdef WIN32
#ifdef _WIN32
#include <string.h>
#endif
#include <std.c>
Expand Down
2 changes: 1 addition & 1 deletion tests/partial_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ product endorsement purposes.
#include <stdlib.h> /* For abort() */
#include <std.c>

#ifdef WIN32
#ifdef _WIN32
#define strtok_r(s,sep,lasts) (*(lasts)=strtok((s),(sep)))
#endif

Expand Down
2 changes: 1 addition & 1 deletion tests/point.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ be used for advertising or product endorsement purposes.
#include "silo.h"
#include <math.h>
#include <stdlib.h>
#ifdef WIN32
#ifdef _WIN32
#include <string.h>
#endif
#include <std.c>
Expand Down
2 changes: 1 addition & 1 deletion tests/sami.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ be used for advertising or product endorsement purposes.
#include <hdf5.h>
#endif

#ifdef WIN32
#ifdef _WIN32
#include <string.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion tests/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ be used for advertising or product endorsement purposes.
#include <math.h>
#include <stdlib.h>
#include <string.h>
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#endif

Expand Down
6 changes: 3 additions & 3 deletions tests/testall.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ be used for advertising or product endorsement purposes.

#include <math.h>
#include <stdlib.h>
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#else
#include <stdio.h>
Expand Down Expand Up @@ -1636,7 +1636,7 @@ build_rect3d(DBfile * dbfile, int size, int order)

DBPutQuadmesh(dbfile, meshname, NULL, coords, dims, ndims, DB_FLOAT,
DB_COLLINEAR, optlist);
#ifndef WIN32
#ifndef _WIN32
binf = open("rect3dz.bin", O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR);
#else
binf = open("rect3dz.bin", O_CREAT|O_TRUNC|O_WRONLY, S_IREAD|S_IWRITE);
Expand All @@ -1653,7 +1653,7 @@ build_rect3d(DBfile * dbfile, int size, int order)
close(binf);
printf("zsize = nz=%d, ny=%d, nx=%d\n", zdims[2], zdims[1], zdims[0]);

#ifndef WIN32
#ifndef _WIN32
binf = open("rect3dn.bin", O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR);
#else
binf = open("rect3dn.bin", O_CREAT|O_TRUNC|O_WRONLY, S_IREAD|S_IWRITE);
Expand Down
2 changes: 1 addition & 1 deletion tests/testfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ herein do not necessarily state or reflect those of the United States
Government or Lawrence Livermore National Security, LLC, and shall not
be used for advertising or product endorsement purposes.
*/
#ifndef WIN32
#ifndef _WIN32
#include <unistd.h>
#else
#include <direct.h>
Expand Down
2 changes: 1 addition & 1 deletion tools/python/pysilo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static PyObject *siloModule = 0;
std::vector<PyMethodDef> SiloMethods;

#if defined(_WIN32)
# if defined(Silo_EXPORTS)
# if defined(SiloPy_EXPORTS) || defined(Silo_EXPORTS)
# define SILOMODULE_API __declspec(dllexport)
# else
# define SILOMODULE_API __declspec(dllimport)
Expand Down