]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Make "pgoff_t" be a typedef not a #define.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 14 Dec 2025 21:53:34 +0000 (16:53 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 14 Dec 2025 21:53:34 +0000 (16:53 -0500)
There doesn't seem to be any great reason why this has been a macro
rather than a typedef.  But doing it like that means our buildfarm
typedef tooling doesn't capture the name as a typedef.  That would
result in pgindent glitches, except that we've seemingly kept it
in typedefs.list manually.  That's obviously error-prone, so let's
convert it to a typedef now.

Discussion: https://postgr.es/m/1681301.1765742268@sss.pgh.pa.us

src/include/port.h
src/include/port/win32_port.h

index 672b880d40b2f1300a8115b7ff1d3bd39d3d455a..af604fddbe7a11da403bae6c33299945926094f5 100644 (file)
@@ -418,7 +418,7 @@ extern FILE *pgwin32_popen(const char *command, const char *type);
 
 /* Type to use with fseeko/ftello */
 #ifndef WIN32                                  /* WIN32 is handled in port/win32_port.h */
-#define pgoff_t off_t
+typedef off_t pgoff_t;
 #endif
 
 #ifndef HAVE_GETPEEREID
index 8194714976faf4515e633094906bd284b504a125..0f4b645f9af338908b9c7e38dc7b2be3877fb405 100644 (file)
@@ -194,7 +194,7 @@ extern DWORD pgwin32_get_file_type(HANDLE hFile);
  * with 64-bit offsets.  Also, fseek() might not give an error for unseekable
  * streams, so harden that function with our version.
  */
-#define pgoff_t __int64
+typedef __int64 pgoff_t;
 
 #ifdef _MSC_VER
 extern int     _pgfseeko64(FILE *stream, pgoff_t offset, int origin);