diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-08-15 14:06:53 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-08-15 14:06:53 (GMT) |
commit | 8d80bf4a93a2de494e710eb9719483178ad215e8 (patch) | |
tree | 733fc801d4b04608cd57bc5003a52513c193dc4d /perform/sio_standalone.h | |
parent | 03a4dd9fc38eba695cb9c169d6879280fc665f3f (diff) | |
download | hdf5-8d80bf4a93a2de494e710eb9719483178ad215e8.zip hdf5-8d80bf4a93a2de494e710eb9719483178ad215e8.tar.gz hdf5-8d80bf4a93a2de494e710eb9719483178ad215e8.tar.bz2 |
[svn-r21228] Added #ifdefs around #include unistd.h and created windows getlogin() function for building HDF5 parallel on windows.
Reviewed and tested locally and tested by user.
Diffstat (limited to 'perform/sio_standalone.h')
-rw-r--r-- | perform/sio_standalone.h | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/perform/sio_standalone.h b/perform/sio_standalone.h index 77bb7f8..42f534f 100644 --- a/perform/sio_standalone.h +++ b/perform/sio_standalone.h @@ -21,7 +21,7 @@ /** From H5private.h **/ -#include "H5public.h" /* Include Public Definitions */ +#include "H5public.h" /* Include Public Definitions */ /* @@ -129,11 +129,11 @@ #define HDfgetc(F) fgetc(F) #define HDfgetpos(F,P) fgetpos(F,P) #define HDfgets(S,N,F) fgets(S,N,F) -#ifdef _WIN32 +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ #define HDfileno(F) _fileno(F) -#else /* _WIN32 */ +#else /* H5_HAVE_VISUAL_STUDIO */ #define HDfileno(F) fileno(F) -#endif /* _WIN32 */ +#endif /* H5_HAVE_VISUAL_STUDIO */ #define HDfloor(X) floor(X) #define HDfmod(X,Y) fmod(X,Y) #define HDfopen(S,M) fopen(S,M) @@ -169,7 +169,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); * For Unix, if off_t is not 64bit big, try use the pseudo-standard * xxx64 versions if available. */ -#ifdef _WIN32 +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ #define HDfstat(F,B) _fstati64(F,B) #define HDlstat(S,B) _lstati64(S,B) #define HDstat(S,B) _stati64(S,B) @@ -202,7 +202,11 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDgetgrgid(G) getgrgid(G) #define HDgetgrnam(S) getgrnam(S) #define HDgetgroups(Z,G) getgroups(Z,G) +#ifdef _MSC_VER /* H5_HAVE_VISUAL_STUDIO */ +#define HDgetlogin() Wgetlogin() +#else /* H5_HAVE_VISUAL_STUDIO */ #define HDgetlogin() getlogin() +#endif /* H5_HAVE_VISUAL_STUDIO */ #define HDgetpgrp() getpgrp() #define HDgetpid() getpid() #define HDgetppid() getppid() @@ -235,7 +239,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDlog(X) log(X) #define HDlog10(X) log10(X) #define HDlongjmp(J,N) longjmp(J,N) -#ifdef _WIN32 +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ #define HDlseek(F,O,W) _lseeki64(F,O,W) #else #ifdef H5_HAVE_LSEEK64 @@ -258,18 +262,18 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z) #define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z) /* - * The (void*) cast just avoids a compiler warning in _WIN32 + * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO */ -#ifdef _WIN32 +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ #define HDmemset(X,C,Z) memset((void*)(X),C,Z) -#else /* _WIN32 */ +#else /* H5_HAVE_VISUAL_STUDIO */ #define HDmemset(X,C,Z) memset(X,C,Z) -#endif /* _WIN32 */ -#ifdef _WIN32 +#endif /* H5_HAVE_VISUAL_STUDIO */ +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ #define HDmkdir(S,M) _mkdir(S) -#else /* _WIN32 */ +#else /* H5_HAVE_VISUAL_STUDIO */ #define HDmkdir(S,M) mkdir(S,M) -#endif /* _WIN32 */ +#endif /* H5_HAVE_VISUAL_STUDIO */ #define HDmkfifo(S,M) mkfifo(S,M) #define HDmktime(T) mktime(T) #define HDmodf(X,Y) modf(X,Y) @@ -331,7 +335,7 @@ int HDremove_all(const char * fname); #define HDsetuid(U) setuid(U) /* Windows does not permit setting the buffer size to values less than 2. */ -#ifndef _WIN32 +#ifndef H5_HAVE_WIN32_API #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z) #else #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2)) @@ -350,7 +354,7 @@ int HDremove_all(const char * fname); #define HDsin(X) sin(X) #define HDsinh(X) sinh(X) #define HDsleep(N) sleep(N) -#ifdef _WIN32 +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ #define HDsnprintf _snprintf /*varargs*/ #else #define HDsnprintf snprintf /*varargs*/ @@ -369,7 +373,7 @@ H5_DLL void HDsrand(unsigned int seed); #endif /* sscanf() variable arguments */ -#define HDstrcasecmp(X,Y) strcasecmp(X,Y) +#define HDstrcasecmp(X,Y) strcasecmp(X,Y) #define HDstrcat(X,Y) strcat(X,Y) #define HDstrchr(S,C) strchr(S,C) #define HDstrcmp(X,Y) strcmp(X,Y) @@ -415,7 +419,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); #define HDumask(N) umask(N) #define HDuname(S) uname(S) #define HDungetc(C,F) ungetc(C,F) -#ifdef _WIN32 +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ #define HDunlink(S) _unlink(S) #else #define HDunlink(S) unlink(S) @@ -428,7 +432,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); #define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A) #define HDvprintf(FMT,A) vprintf(FMT,A) #define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A) -#ifdef _WIN32 +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ # define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A) #else # define HDvsnprintf(S,N,FMT,A) vsnprintf(S,N,FMT,A) @@ -443,9 +447,9 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); * And now for a couple non-Posix functions... Watch out for systems that * define these in terms of macros. */ -#ifdef _WIN32 +#ifdef _WIN32 /* H5_HAVE_VISUAL_STUDIO */ #define HDstrdup(S) _strdup(S) -#else /* _WIN32 */ +#else /* H5_HAVE_VISUAL_STUDIO */ #if !defined strdup && !defined H5_HAVE_STRDUP extern char *strdup(const char *s); @@ -453,7 +457,7 @@ extern char *strdup(const char *s); #define HDstrdup(S) strdup(S) -#endif /* _WIN32 */ +#endif /* H5_HAVE_VISUAL_STUDIO */ /* * HDF Boolean type. @@ -487,7 +491,7 @@ extern const char *opt_arg; /* flag argument (or value) */ enum { no_arg = 0, /* doesn't take an argument */ - require_arg, /* requires an argument */ + require_arg, /* requires an argument */ optional_arg /* argument is optional */ }; |