diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2015-05-27 16:23:38 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2015-05-27 16:23:38 +0200 |
commit | b6a56370d6e833f8033169ebb4e91cdce4d911aa (patch) | |
tree | 84f758dc0afbfc7882727e0d43d88666ee55d648 /storage/connect/tabmul.cpp | |
parent | fb98632930cd320c55a8664f601c4082b3e14628 (diff) | |
download | mariadb-git-b6a56370d6e833f8033169ebb4e91cdce4d911aa.tar.gz |
Change all preprocessor compiler directives to use __WIN__ as the mean of
specifying Windows or not Windows compile. This is what MariaDB does.
modified: storage/connect/array.cpp
modified: storage/connect/blkfil.cpp
modified: storage/connect/block.h
modified: storage/connect/colblk.cpp
modified: storage/connect/domdoc.cpp
modified: storage/connect/filamap.cpp
modified: storage/connect/filamdbf.cpp
modified: storage/connect/filamfix.cpp
modified: storage/connect/filamtxt.cpp
modified: storage/connect/filamvct.cpp
modified: storage/connect/filamzip.cpp
modified: storage/connect/filter.cpp
modified: storage/connect/filter.h
modified: storage/connect/fmdlex.c
modified: storage/connect/global.h
modified: storage/connect/ha_connect.cc
modified: storage/connect/json.cpp
modified: storage/connect/macutil.cpp
modified: storage/connect/macutil.h
modified: storage/connect/maputil.cpp
modified: storage/connect/mycat.cc
modified: storage/connect/myconn.cpp
modified: storage/connect/myconn.h
modified: storage/connect/myutil.cpp
modified: storage/connect/odbconn.cpp
modified: storage/connect/odbconn.h
modified: storage/connect/os.h
modified: storage/connect/osutil.c
modified: storage/connect/plgdbsem.h
modified: storage/connect/plgdbutl.cpp
modified: storage/connect/plugutil.c
modified: storage/connect/rcmsg.c
modified: storage/connect/reldef.cpp
modified: storage/connect/reldef.h
modified: storage/connect/tabdos.cpp
modified: storage/connect/tabfix.cpp
modified: storage/connect/tabfmt.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabmac.cpp
modified: storage/connect/tabmac.h
modified: storage/connect/tabmul.cpp
modified: storage/connect/tabmul.h
modified: storage/connect/tabmysql.cpp
modified: storage/connect/taboccur.cpp
modified: storage/connect/tabodbc.cpp
modified: storage/connect/tabpivot.cpp
modified: storage/connect/tabsys.cpp
modified: storage/connect/tabtbl.cpp
modified: storage/connect/tabutil.cpp
modified: storage/connect/tabvct.cpp
modified: storage/connect/tabwmi.cpp
modified: storage/connect/tabxcl.cpp
modified: storage/connect/tabxml.cpp
modified: storage/connect/valblk.cpp
modified: storage/connect/value.cpp
modified: storage/connect/xindex.cpp
modified: storage/connect/xindex.h
Diffstat (limited to 'storage/connect/tabmul.cpp')
-rw-r--r-- | storage/connect/tabmul.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/storage/connect/tabmul.cpp b/storage/connect/tabmul.cpp index 12e8de2c808..3008ca1b8ca 100644 --- a/storage/connect/tabmul.cpp +++ b/storage/connect/tabmul.cpp @@ -37,7 +37,7 @@ /* Include relevant section of system dependant header files. */ /***********************************************************************/ #include "my_global.h" -#if defined(WIN32) +#if defined(__WIN__) #include <stdlib.h> #include <stdio.h> #if defined(__BORLANDC__) @@ -145,7 +145,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) /*******************************************************************/ /* To_File is a multiple name with special characters */ /*******************************************************************/ -#if defined(WIN32) +#if defined(__WIN__) char drive[_MAX_DRIVE], direc[_MAX_DIR]; WIN32_FIND_DATA FileData; HANDLE hSearch; @@ -196,7 +196,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) return true; } // endif FindClose -#else // !WIN32 +#else // !__WIN__ struct stat fileinfo; char fn[FN_REFLEN], direc[FN_REFLEN], pattern[FN_HEADLEN], ftype[FN_EXTLEN]; DIR *dir; @@ -249,7 +249,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) // Close the dir handle. closedir(dir); -#endif // !WIN32 +#endif // !__WIN__ } else { /*******************************************************************/ @@ -269,7 +269,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) p = filename + strlen(filename) - 1; -#if defined(UNIX) +#if !defined(__WIN__) // Data files can be imported from Windows (having CRLF) if (*p == '\n' || *p == '\r') { // is this enough for Unix ??? @@ -297,7 +297,7 @@ bool TDBMUL::InitFileNames(PGLOBAL g) } // endif Mul -#if defined(WIN32) +#if defined(__WIN__) suite: #endif @@ -620,17 +620,17 @@ TDBDIR::TDBDIR(PDIRDEF tdp) : TDBASE(tdp) { To_File = tdp->Fn; iFile = 0; -#if defined(WIN32) +#if defined(__WIN__) memset(&FileData, 0, sizeof(_finddata_t)); Hsearch = -1; *Drive = '\0'; -#else // !WIN32 +#else // !__WIN__ memset(&Fileinfo, 0, sizeof(struct stat)); Entry = NULL; Dir = NULL; Done = false; *Pattern = '\0'; -#endif // !WIN32 +#endif // !__WIN__ *Fpath = '\0'; *Direc = '\0'; *Fname = '\0'; @@ -641,17 +641,17 @@ TDBDIR::TDBDIR(PTDBDIR tdbp) : TDBASE(tdbp) { To_File = tdbp->To_File; iFile = tdbp->iFile; -#if defined(WIN32) +#if defined(__WIN__) FileData = tdbp->FileData; Hsearch = tdbp->Hsearch; strcpy(Drive, tdbp->Drive); -#else // !WIN32 +#else // !__WIN__ Fileinfo = tdbp->Fileinfo; Entry = tdbp->Entry; Dir = tdbp->Dir; Done = tdbp->Done; strcpy(Pattern, tdbp->Pattern); -#endif // !WIN32 +#endif // !__WIN__ strcpy(Direc, tdbp->Direc); strcpy(Fname, tdbp->Fname); strcpy(Ftype, tdbp->Ftype); @@ -675,7 +675,7 @@ char* TDBDIR::Path(PGLOBAL g) { PCATLG cat = PlgGetCatalog(g); -#if defined(WIN32) +#if defined(__WIN__) if (!*Drive) { PlugSetPath(Fpath, To_File, ((PTABDEF)To_Def)->GetPath()); _splitpath(Fpath, Drive, Direc, Fname, Ftype); @@ -683,7 +683,7 @@ char* TDBDIR::Path(PGLOBAL g) _makepath(Fpath, Drive, Direc, Fname, Ftype); // Usefull ??? return Fpath; -#else // !WIN32 +#else // !__WIN__ if (!Done) { PlugSetPath(Fpath, To_File, ((PTABDEF)To_Def)->GetPath()); _splitpath(Fpath, NULL, Direc, Fname, Ftype); @@ -692,7 +692,7 @@ char* TDBDIR::Path(PGLOBAL g) } // endif Done return Pattern; -#endif // !WIN32 +#endif // !__WIN__ } // end of Path /***********************************************************************/ @@ -710,7 +710,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g) { if (MaxSize < 0) { int n = -1; -#if defined(WIN32) +#if defined(__WIN__) int h; // Start searching files in the target directory. @@ -726,7 +726,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g) } else n = 0; -#else // !WIN32 +#else // !__WIN__ Path(g); // Start searching files in the target directory. @@ -750,7 +750,7 @@ int TDBDIR::GetMaxSize(PGLOBAL g) // Close the DIR handle. closedir(Dir); -#endif // !WIN32 +#endif // !__WIN__ MaxSize = n; } // endif MaxSize @@ -776,10 +776,10 @@ bool TDBDIR::OpenDB(PGLOBAL g) } // endif use Use = USE_OPEN; -#if !defined(WIN32) +#if !defined(__WIN__) Path(g); // Be sure it is done Dir = NULL; // For ReadDB -#endif // !WIN32 +#endif // !__WIN__ return false; } // end of OpenDB @@ -790,7 +790,7 @@ int TDBDIR::ReadDB(PGLOBAL g) { int rc = RC_OK; -#if defined(WIN32) +#if defined(__WIN__) if (Hsearch == -1) { /*******************************************************************/ /* Start searching files in the target directory. The use of the */ @@ -848,7 +848,7 @@ int TDBDIR::ReadDB(PGLOBAL g) rc = RC_EF; } // endif Entry -#endif // !WIN32 +#endif // !__WIN__ return rc; } // end of ReadDB @@ -876,17 +876,17 @@ int TDBDIR::DeleteDB(PGLOBAL g, int) /***********************************************************************/ void TDBDIR::CloseDB(PGLOBAL) { -#if defined(WIN32) +#if defined(__WIN__) // Close the search handle. _findclose(Hsearch); Hsearch = -1; -#else // !WIN32 +#else // !__WIN__ // Close the DIR handle if (Dir) { closedir(Dir); Dir = NULL; } // endif dir -#endif // !WIN32 +#endif // !__WIN__ iFile = 0; } // end of CloseDB @@ -935,19 +935,19 @@ void DIRCOL::ReadColumn(PGLOBAL g) /* Retrieve the information corresponding to the column number. */ /*********************************************************************/ switch (N) { -#if defined(WIN32) +#if defined(__WIN__) case 0: Value->SetValue_psz(tdbp->Drive); break; -#endif // WIN32 +#endif // __WIN__ case 1: Value->SetValue_psz(tdbp->Direc); break; case 2: Value->SetValue_psz(tdbp->Fname); break; case 3: Value->SetValue_psz(tdbp->Ftype); break; -#if defined(WIN32) +#if defined(__WIN__) case 4: Value->SetValue((int)tdbp->FileData.attrib); break; case 5: Value->SetValue((int)tdbp->FileData.size); break; case 6: Value->SetValue((int)tdbp->FileData.time_write); break; case 7: Value->SetValue((int)tdbp->FileData.time_create); break; case 8: Value->SetValue((int)tdbp->FileData.time_access); break; -#else // !WIN32 +#else // !__WIN__ case 4: Value->SetValue((int)tdbp->Fileinfo.st_mode); break; case 5: Value->SetValue((int)tdbp->Fileinfo.st_size); break; case 6: Value->SetValue((int)tdbp->Fileinfo.st_mtime); break; @@ -955,7 +955,7 @@ void DIRCOL::ReadColumn(PGLOBAL g) case 8: Value->SetValue((int)tdbp->Fileinfo.st_atime); break; case 9: Value->SetValue((int)tdbp->Fileinfo.st_uid); break; case 10: Value->SetValue((int)tdbp->Fileinfo.st_gid); break; -#endif // !WIN32 +#endif // !__WIN__ default: sprintf(g->Message, MSG(INV_DIRCOL_OFST), N); longjmp(g->jumper[g->jump_level], GetAmType()); @@ -1006,7 +1006,7 @@ int TDBSDR::FindInDir(PGLOBAL g) size_t m = strlen(Direc); // Start searching files in the target directory. -#if defined(WIN32) +#if defined(__WIN__) int h = _findfirst(Path(g), &FileData); if (h != -1) { @@ -1039,7 +1039,7 @@ int TDBSDR::FindInDir(PGLOBAL g) // Close the search handle. _findclose(h); } // endif h -#else // !WIN32 +#else // !__WIN__ int k; DIR *dir = opendir(Direc); @@ -1073,7 +1073,7 @@ int TDBSDR::FindInDir(PGLOBAL g) // Close the DIR handle. closedir(dir); -#endif // !WIN32 +#endif // !__WIN__ return n; } // end of FindInDir @@ -1089,13 +1089,13 @@ bool TDBSDR::OpenDB(PGLOBAL g) Sub = (PSUBDIR)PlugSubAlloc(g, NULL, sizeof(SUBDIR)); Sub->Next = NULL; Sub->Prev = NULL; -#if defined(WIN32) +#if defined(__WIN__) Sub->H = -1; Sub->Len = strlen(Direc); -#else // !WIN32 +#else // !__WIN__ Sub->D = NULL; Sub->Len = 0; -#endif // !WIN32 +#endif // !__WIN__ } // endif To_Sub return TDBDIR::OpenDB(g); @@ -1108,7 +1108,7 @@ int TDBSDR::ReadDB(PGLOBAL g) { int rc; -#if defined(WIN32) +#if defined(__WIN__) again: rc = TDBDIR::ReadDB(g); @@ -1160,7 +1160,7 @@ int TDBSDR::ReadDB(PGLOBAL g) } // endif H } // endif rc -#else // !WIN32 +#else // !__WIN__ rc = RC_NF; again: @@ -1217,7 +1217,7 @@ int TDBSDR::ReadDB(PGLOBAL g) } // endif Entry -#endif // !WIN32 +#endif // !__WIN__ return rc; } // end of ReadDB |