]> granicus.if.org Git - postgresql/commitdiff
Fix compiling errors on Windows platform. Fix wrong usage of
authorTatsuo Ishii <ishii@postgresql.org>
Sun, 7 Oct 2012 14:30:31 +0000 (23:30 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Sun, 7 Oct 2012 14:30:31 +0000 (23:30 +0900)
INT64CONST macro. Fix lo_hton64 and lo_ntoh64 not to use int32_t and
uint32_t.

src/include/storage/large_object.h
src/interfaces/libpq/fe-lobj.c

index 52f01c6e3c393311dfb852bdd6ff7b944bc87155..715f0c3bc49ce1141e61f0914fc502c3cdfce55e 100644 (file)
@@ -65,7 +65,7 @@ typedef struct LargeObjectDesc
 /*
  * Maximum byte length for each large object
 */
-#define MAX_LARGE_OBJECT_SIZE  INT64CONST(INT_MAX * LOBLKSIZE)
+#define MAX_LARGE_OBJECT_SIZE  ((int64)INT_MAX * LOBLKSIZE)
 
 /*
  * Function definitions...
index fb17ac8b1e9cc47f9f0f8187754fe7aa92772d13..022cfec0932474c450354d7db864f7c522e7b666 100644 (file)
@@ -1046,13 +1046,13 @@ static pg_int64
 lo_hton64(pg_int64 host64)
 {
        pg_int64        result;
-       uint32_t        h32, l32;
+       uint32  h32, l32;
 
        /* High order half first, since we're doing MSB-first */
-       h32 = (uint32_t) (host64 >> 32);
+       h32 = (uint32) (host64 >> 32);
 
        /* Now the low order half */
-       l32 = (uint32_t) (host64 & 0xffffffff);
+       l32 = (uint32) (host64 & 0xffffffff);
 
        result = htonl(l32);
        result <<= 32;
@@ -1069,10 +1069,10 @@ static pg_int64
 lo_ntoh64(pg_int64 net64)
 {
        pg_int64        result;
-       uint32_t        h32, l32;
+       uint32  h32, l32;
 
-       l32 = (uint32_t) (net64 >> 32);
-       h32 = (uint32_t) (net64 & 0xffffffff);
+       l32 = (uint32) (net64 >> 32);
+       h32 = (uint32) (net64 & 0xffffffff);
 
        result = ntohl(h32);
        result <<= 32;