diff options
Diffstat (limited to 'storage/connect/filamfix.cpp')
-rw-r--r-- | storage/connect/filamfix.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp index d27551bb97d..46f3ea01129 100644 --- a/storage/connect/filamfix.cpp +++ b/storage/connect/filamfix.cpp @@ -17,7 +17,7 @@ /* Include relevant sections of the System header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(__WIN__) +#if defined(_WIN32) #include <io.h> #include <fcntl.h> #include <errno.h> @@ -25,7 +25,7 @@ #define __MFC_COMPAT__ // To define min/max as macro #endif // __BORLANDC__ //#include <windows.h> -#else // !__WIN__ +#else // !_WIN32 #if defined(UNIX) #include <errno.h> #include <unistd.h> @@ -34,7 +34,7 @@ #endif // !UNIX #include <sys/stat.h> #include <fcntl.h> -#endif // !__WIN__ +#endif // !_WIN32 /***********************************************************************/ /* Include application header files: */ @@ -336,7 +336,7 @@ int FIXFAM::ReadBuffer(PGLOBAL g) } else if (feof(Stream)) { rc = RC_EF; } else { -#if defined(__WIN__) +#if defined(_WIN32) sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL)); #else sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(errno)); @@ -676,7 +676,7 @@ BGXFAM::BGXFAM(PBGXFAM txfp) : FIXFAM(txfp) /***********************************************************************/ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org) { -#if defined(__WIN__) +#if defined(_WIN32) char buf[256]; DWORD drc; LARGE_INTEGER of; @@ -692,14 +692,14 @@ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org) sprintf(g->Message, MSG(SFP_ERROR), buf); return true; } // endif -#else // !__WIN__ +#else // !_WIN32 if (lseek64(h, pos, org) < 0) { // sprintf(g->Message, MSG(ERROR_IN_LSK), errno); sprintf(g->Message, "lseek64: %s", strerror(errno)); printf("%s\n", g->Message); return true; } // endif -#endif // !__WIN__ +#endif // !_WIN32 return false; } // end of BigSeek @@ -712,7 +712,7 @@ int BGXFAM::BigRead(PGLOBAL g __attribute__((unused)), { int rc; -#if defined(__WIN__) +#if defined(_WIN32) DWORD nbr, drc, len = (DWORD)req; bool brc = ReadFile(h, inbuf, len, &nbr, NULL); @@ -734,12 +734,12 @@ int BGXFAM::BigRead(PGLOBAL g __attribute__((unused)), rc = -1; } else rc = (int)nbr; -#else // !__WIN__ +#else // !_WIN32 size_t len = (size_t)req; ssize_t nbr = read(h, inbuf, len); rc = (int)nbr; -#endif // !__WIN__ +#endif // !_WIN32 return rc; } // end of BigRead @@ -751,7 +751,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) { bool rc = false; -#if defined(__WIN__) +#if defined(_WIN32) DWORD nbw, drc, len = (DWORD)req; bool brc = WriteFile(h, inbuf, len, &nbw, NULL); @@ -779,7 +779,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) rc = true; } // endif brc || nbw -#else // !__WIN__ +#else // !_WIN32 size_t len = (size_t)req; ssize_t nbw = write(h, inbuf, len); @@ -794,7 +794,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req) rc = true; } // endif nbr -#endif // !__WIN__ +#endif // !_WIN32 return rc; } // end of BigWrite @@ -829,7 +829,7 @@ bool BGXFAM::OpenTableFile(PGLOBAL g) if (trace(1)) htrc("OpenTableFile: filename=%s mode=%d\n", filename, mode); -#if defined(__WIN__) +#if defined(_WIN32) DWORD rc, access, creation, share = 0; /*********************************************************************/ @@ -987,7 +987,7 @@ int BGXFAM::Cardinality(PGLOBAL g) PlugSetPath(filename, To_File, Tdbp->GetPath()); -#if defined(__WIN__) // OB +#if defined(_WIN32) // OB LARGE_INTEGER len; DWORD rc = 0; @@ -1346,7 +1346,7 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc) /*****************************************************************/ /* Remove extra records. */ /*****************************************************************/ -#if defined(__WIN__) +#if defined(_WIN32) if (BigSeek(g, Hfile, (BIGINT)Tpos * (BIGINT)Lrecl)) return RC_FX; @@ -1356,12 +1356,12 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc) sprintf(g->Message, MSG(SETEOF_ERROR), drc); return RC_FX; } // endif error -#else // !__WIN__ +#else // !_WIN32 if (ftruncate64(Hfile, (BIGINT)(Tpos * Lrecl))) { sprintf(g->Message, MSG(TRUNCATE_ERROR), strerror(errno)); return RC_FX; } // endif -#endif // !__WIN__ +#endif // !_WIN32 } // endif UseTemp @@ -1386,7 +1386,7 @@ bool BGXFAM::OpenTempFile(PGLOBAL g) strcat(PlugRemoveType(tempname, tempname), ".t"); remove(tempname); // Be sure it does not exist yet -#if defined(__WIN__) +#if defined(_WIN32) Tfile = CreateFile(tempname, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL); @@ -1526,7 +1526,7 @@ void BGXFAM::CloseTableFile(PGLOBAL g, bool abort) void BGXFAM::Rewind(void) { #if 0 // This is probably unuseful because file is accessed directly -#if defined(__WIN__) //OB +#if defined(_WIN32) //OB SetFilePointer(Hfile, 0, NULL, FILE_BEGIN); #else // UNIX lseek64(Hfile, 0, SEEK_SET); |