Skip to content

Commit e8ea671

Browse files
committed
Commit changes pulled from ob-10.0
1 parent 893631a commit e8ea671

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+866
-737
lines changed

storage/connect/array.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
#include "sql_class.h"
2020
//#include "sql_time.h"
2121

22-
#if defined(WIN32)
22+
#if defined(__WIN__)
2323
//#include <windows.h>
24-
#else // !WIN32
24+
#else // !__WIN__
2525
#include <string.h>
2626
#include <sys/types.h>
2727
#include <sys/stat.h>
2828
#include <stdint.h> // for uintprt_h
29-
#endif // !WIN32
29+
#endif // !__WIN__
3030

3131
/***********************************************************************/
3232
/* Include required application header files */

storage/connect/blkfil.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
#include "sql_class.h"
2121
//#include "sql_time.h"
2222

23-
#if defined(WIN32)
23+
#if defined(__WIN__)
2424
//#include <windows.h>
25-
#else // !WIN32
25+
#else // !__WIN__
2626
#include <string.h>
2727
#include <sys/types.h>
2828
#include <sys/stat.h>
29-
#endif // !WIN32
29+
#endif // !__WIN__
3030

3131
/***********************************************************************/
3232
/* Include application header files: */

storage/connect/block.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
#if !defined(BLOCK_DEFINED)
2525
#define BLOCK_DEFINED
2626

27-
#if defined(WIN32) && !defined(NOEX)
27+
#if defined(__WIN__) && !defined(NOEX)
2828
#define DllExport __declspec( dllexport )
29-
#else // !WIN32
29+
#else // !__WIN__
3030
#define DllExport
31-
#endif // !WIN32
31+
#endif // !__WIN__
3232

3333
/***********************************************************************/
3434
/* Definition of class BLOCK with its method function new. */
@@ -38,7 +38,7 @@ typedef class BLOCK *PBLOCK;
3838
class DllExport BLOCK {
3939
public:
4040
void * operator new(size_t size, PGLOBAL g, void *p = NULL) {
41-
// if (trace > 2)
41+
// if (trace > 3)
4242
// htrc("New BLOCK: size=%d g=%p p=%p\n", size, g, p);
4343

4444
return (PlugSubAlloc(g, p, size));

storage/connect/colblk.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ FIDBLK::FIDBLK(PCOLUMN cp, OPVAL op) : SPCBLK(cp), Op(op)
297297
Buf_Type = TYPE_STRING;
298298
*Format.Type = 'C';
299299
Format.Length = Long;
300-
#if defined(WIN32)
300+
#if defined(__WIN__)
301301
Format.Prec = 1; // Case insensitive
302-
#endif // WIN32
302+
#endif // __WIN__
303303
Constant = (!((PTDBASE)To_Tdb)->GetDef()->GetMultiple() &&
304304
To_Tdb->GetAmType() != TYPE_AM_PLG &&
305305
To_Tdb->GetAmType() != TYPE_AM_PLM);

storage/connect/domdoc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/******************************************************************/
55
#include "my_global.h"
66
#include <stdio.h>
7-
#if defined(WIN32)
7+
#if defined(__WIN__)
88
//#include <windows.h>
99
#if defined(MSX2)
1010
#import "msxml2.dll" //Does not exist on Vista

storage/connect/filamap.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
/* Include relevant sections of the System header files. */
1818
/***********************************************************************/
1919
#include "my_global.h"
20-
#if defined(WIN32)
20+
#if defined(__WIN__)
2121
#if defined(__BORLANDC__)
2222
#define __MFC_COMPAT__ // To define min/max as macro
2323
#endif // __BORLANDC__
2424
//#include <windows.h>
25-
#else // !WIN32
25+
#else // !__WIN__
2626
#if defined(UNIX)
2727
#include <errno.h>
2828
#include <unistd.h>
2929
#else // !UNIX
3030
#include <io.h>
3131
#endif // !UNIX
3232
#include <fcntl.h>
33-
#endif // !WIN32
33+
#endif // !__WIN__
3434

3535
/***********************************************************************/
3636
/* Include application header files: */
@@ -191,11 +191,11 @@ bool MAPFAM::OpenTableFile(PGLOBAL g)
191191
return true;
192192
} // endif Memory
193193

194-
#if defined(WIN32)
194+
#if defined(__WIN__)
195195
if (mode != MODE_DELETE) {
196-
#else // !WIN32
196+
#else // !__WIN__
197197
if (mode == MODE_READ) {
198-
#endif // !WIN32
198+
#endif // !__WIN__
199199
CloseFileHandle(hFile); // Not used anymore
200200
hFile = INVALID_HANDLE_VALUE; // For Fblock
201201
} // endif Mode
@@ -452,7 +452,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc)
452452
/*****************************************************************/
453453
n = Tpos - Memory;
454454

455-
#if defined(WIN32)
455+
#if defined(__WIN__)
456456
DWORD drc = SetFilePointer(fp->Handle, n, NULL, FILE_BEGIN);
457457

458458
if (drc == 0xFFFFFFFF) {
@@ -482,7 +482,7 @@ int MAPFAM::DeleteRecords(PGLOBAL g, int irc)
482482
#endif // UNIX
483483
} // endif Abort
484484

485-
#if defined(WIN32)
485+
#if defined(__WIN__)
486486
CloseHandle(fp->Handle);
487487
#else // UNIX
488488
close(fp->Handle);

storage/connect/filamdbf.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@
2222
/* Include relevant sections of the System header files. */
2323
/***********************************************************************/
2424
#include "my_global.h"
25-
#if defined(WIN32)
25+
#if defined(__WIN__)
2626
#include <io.h>
2727
#include <fcntl.h>
2828
//#include <errno.h>
2929
//#include <windows.h>
30-
#else // !WIN32
30+
#else // !__WIN__
3131
#if defined(UNIX)
3232
#include <errno.h>
3333
#include <unistd.h>
3434
#else // !UNIX
3535
//#include <io.h>
3636
#endif // !UNIX
3737
//#include <fcntl.h>
38-
#endif // !WIN32
38+
#endif // !__WIN__
3939
#include <ctype.h>
4040
#include <stdio.h>
4141
#include <string.h>
@@ -528,7 +528,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
528528
To_Buf = (char*)PlugSubAlloc(g, NULL, Buflen);
529529

530530
if (mode == MODE_INSERT) {
531-
#if defined(WIN32)
531+
#if defined(__WIN__)
532532
/************************************************************************/
533533
/* Now we can revert to binary mode in particular because the eventual */
534534
/* writing of a new header must be done in binary mode to avoid */
@@ -538,7 +538,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
538538
sprintf(g->Message, MSG(BIN_MODE_FAIL), strerror(errno));
539539
return true;
540540
} // endif setmode
541-
#endif // WIN32
541+
#endif // __WIN__
542542

543543
/************************************************************************/
544544
/* If this is a new file, the header must be generated. */

storage/connect/filamfix.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
/* Include relevant sections of the System header files. */
1818
/***********************************************************************/
1919
#include "my_global.h"
20-
#if defined(WIN32)
20+
#if defined(__WIN__)
2121
#include <io.h>
2222
#include <fcntl.h>
2323
#include <errno.h>
2424
#if defined(__BORLANDC__)
2525
#define __MFC_COMPAT__ // To define min/max as macro
2626
#endif // __BORLANDC__
2727
//#include <windows.h>
28-
#else // !WIN32
28+
#else // !__WIN__
2929
#if defined(UNIX)
3030
#include <errno.h>
3131
#include <unistd.h>
@@ -34,7 +34,7 @@
3434
#endif // !UNIX
3535
#include <sys/stat.h>
3636
#include <fcntl.h>
37-
#endif // !WIN32
37+
#endif // !__WIN__
3838

3939
/***********************************************************************/
4040
/* Include application header files: */
@@ -338,10 +338,10 @@ int FIXFAM::ReadBuffer(PGLOBAL g)
338338
} else if (feof(Stream)) {
339339
rc = RC_EF;
340340
} else {
341-
#if defined(UNIX)
342-
sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(errno));
343-
#else
341+
#if defined(__WIN__)
344342
sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL));
343+
#else
344+
sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(errno));
345345
#endif
346346

347347
if (trace)
@@ -678,7 +678,7 @@ BGXFAM::BGXFAM(PBGXFAM txfp) : FIXFAM(txfp)
678678
/***********************************************************************/
679679
bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org)
680680
{
681-
#if defined(WIN32)
681+
#if defined(__WIN__)
682682
char buf[256];
683683
DWORD drc;
684684
LARGE_INTEGER of;
@@ -694,14 +694,14 @@ bool BGXFAM::BigSeek(PGLOBAL g, HANDLE h, BIGINT pos, int org)
694694
sprintf(g->Message, MSG(SFP_ERROR), buf);
695695
return true;
696696
} // endif
697-
#else // !WIN32
697+
#else // !__WIN__
698698
if (lseek64(h, pos, org) < 0) {
699699
// sprintf(g->Message, MSG(ERROR_IN_LSK), errno);
700700
sprintf(g->Message, "lseek64: %s", strerror(errno));
701701
printf("%s\n", g->Message);
702702
return true;
703703
} // endif
704-
#endif // !WIN32
704+
#endif // !__WIN__
705705

706706
return false;
707707
} // end of BigSeek
@@ -714,7 +714,7 @@ int BGXFAM::BigRead(PGLOBAL g __attribute__((unused)),
714714
{
715715
int rc;
716716

717-
#if defined(WIN32)
717+
#if defined(__WIN__)
718718
DWORD nbr, drc, len = (DWORD)req;
719719
bool brc = ReadFile(h, inbuf, len, &nbr, NULL);
720720

@@ -736,12 +736,12 @@ int BGXFAM::BigRead(PGLOBAL g __attribute__((unused)),
736736
rc = -1;
737737
} else
738738
rc = (int)nbr;
739-
#else // !WIN32
739+
#else // !__WIN__
740740
size_t len = (size_t)req;
741741
ssize_t nbr = read(h, inbuf, len);
742742

743743
rc = (int)nbr;
744-
#endif // !WIN32
744+
#endif // !__WIN__
745745

746746
return rc;
747747
} // end of BigRead
@@ -753,7 +753,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req)
753753
{
754754
bool rc = false;
755755

756-
#if defined(WIN32)
756+
#if defined(__WIN__)
757757
DWORD nbw, drc, len = (DWORD)req;
758758
bool brc = WriteFile(h, inbuf, len, &nbw, NULL);
759759

@@ -780,7 +780,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req)
780780

781781
rc = true;
782782
} // endif brc || nbw
783-
#else // !WIN32
783+
#else // !__WIN__
784784
size_t len = (size_t)req;
785785
ssize_t nbw = write(h, inbuf, len);
786786

@@ -795,7 +795,7 @@ bool BGXFAM::BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req)
795795

796796
rc = true;
797797
} // endif nbr
798-
#endif // !WIN32
798+
#endif // !__WIN__
799799

800800
return rc;
801801
} // end of BigWrite
@@ -830,7 +830,7 @@ bool BGXFAM::OpenTableFile(PGLOBAL g)
830830
if (trace)
831831
htrc("OpenTableFile: filename=%s mode=%d\n", filename, mode);
832832

833-
#if defined(WIN32)
833+
#if defined(__WIN__)
834834
DWORD rc, access, creation, share = 0;
835835

836836
/*********************************************************************/
@@ -987,7 +987,7 @@ int BGXFAM::Cardinality(PGLOBAL g)
987987

988988
PlugSetPath(filename, To_File, Tdbp->GetPath());
989989

990-
#if defined(WIN32) // OB
990+
#if defined(__WIN__) // OB
991991
LARGE_INTEGER len;
992992
DWORD rc = 0;
993993

@@ -1346,7 +1346,7 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc)
13461346
/*****************************************************************/
13471347
/* Remove extra records. */
13481348
/*****************************************************************/
1349-
#if defined(WIN32)
1349+
#if defined(__WIN__)
13501350
if (BigSeek(g, Hfile, (BIGINT)Tpos * (BIGINT)Lrecl))
13511351
return RC_FX;
13521352

@@ -1356,12 +1356,12 @@ int BGXFAM::DeleteRecords(PGLOBAL g, int irc)
13561356
sprintf(g->Message, MSG(SETEOF_ERROR), drc);
13571357
return RC_FX;
13581358
} // endif error
1359-
#else // !WIN32
1359+
#else // !__WIN__
13601360
if (ftruncate64(Hfile, (BIGINT)(Tpos * Lrecl))) {
13611361
sprintf(g->Message, MSG(TRUNCATE_ERROR), strerror(errno));
13621362
return RC_FX;
13631363
} // endif
1364-
#endif // !WIN32
1364+
#endif // !__WIN__
13651365

13661366
} // endif UseTemp
13671367

@@ -1386,7 +1386,7 @@ bool BGXFAM::OpenTempFile(PGLOBAL g)
13861386
strcat(PlugRemoveType(tempname, tempname), ".t");
13871387
remove(tempname); // Be sure it does not exist yet
13881388

1389-
#if defined(WIN32)
1389+
#if defined(__WIN__)
13901390
Tfile = CreateFile(tempname, GENERIC_WRITE, 0, NULL,
13911391
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
13921392

@@ -1526,7 +1526,7 @@ void BGXFAM::CloseTableFile(PGLOBAL g, bool abort)
15261526
void BGXFAM::Rewind(void)
15271527
{
15281528
#if 0 // This is probably unuseful because file is accessed directly
1529-
#if defined(WIN32) //OB
1529+
#if defined(__WIN__) //OB
15301530
SetFilePointer(Hfile, 0, NULL, FILE_BEGIN);
15311531
#else // UNIX
15321532
lseek64(Hfile, 0, SEEK_SET);

0 commit comments

Comments
 (0)