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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 6 additions & 6 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy