Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7e2f8ed

Browse files
committed
Fix compiling errors on Windows platform. Fix wrong usage of
INT64CONST macro. Fix lo_hton64 and lo_ntoh64 not to use int32_t and uint32_t.
1 parent b51a65f commit 7e2f8ed

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/include/storage/large_object.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typedef struct LargeObjectDesc
6565
/*
6666
* Maximum byte length for each large object
6767
*/
68-
#define MAX_LARGE_OBJECT_SIZE INT64CONST(INT_MAX * LOBLKSIZE)
68+
#define MAX_LARGE_OBJECT_SIZE ((int64)INT_MAX * LOBLKSIZE)
6969

7070
/*
7171
* Function definitions...

src/interfaces/libpq/fe-lobj.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1046,13 +1046,13 @@ static pg_int64
10461046
lo_hton64(pg_int64 host64)
10471047
{
10481048
pg_int64 result;
1049-
uint32_t h32, l32;
1049+
uint32 h32, l32;
10501050

10511051
/* High order half first, since we're doing MSB-first */
1052-
h32 = (uint32_t) (host64 >> 32);
1052+
h32 = (uint32) (host64 >> 32);
10531053

10541054
/* Now the low order half */
1055-
l32 = (uint32_t) (host64 & 0xffffffff);
1055+
l32 = (uint32) (host64 & 0xffffffff);
10561056

10571057
result = htonl(l32);
10581058
result <<= 32;
@@ -1069,10 +1069,10 @@ static pg_int64
10691069
lo_ntoh64(pg_int64 net64)
10701070
{
10711071
pg_int64 result;
1072-
uint32_t h32, l32;
1072+
uint32 h32, l32;
10731073

1074-
l32 = (uint32_t) (net64 >> 32);
1075-
h32 = (uint32_t) (net64 & 0xffffffff);
1074+
l32 = (uint32) (net64 >> 32);
1075+
h32 = (uint32) (net64 & 0xffffffff);
10761076

10771077
result = ntohl(h32);
10781078
result <<= 32;

0 commit comments

Comments
 (0)