🌐 AI搜索 & 代理 主页
Skip to content

Commit 66b2282

Browse files
committed
Make "pgoff_t" be a typedef not a #define.
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
1 parent fe7ede4 commit 66b2282

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/include/port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ extern FILE *pgwin32_popen(const char *command, const char *type);
418418

419419
/* Type to use with fseeko/ftello */
420420
#ifndef WIN32 /* WIN32 is handled in port/win32_port.h */
421-
#define pgoff_t off_t
421+
typedef off_t pgoff_t;
422422
#endif
423423

424424
#ifndef HAVE_GETPEEREID

src/include/port/win32_port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ extern DWORD pgwin32_get_file_type(HANDLE hFile);
194194
* with 64-bit offsets. Also, fseek() might not give an error for unseekable
195195
* streams, so harden that function with our version.
196196
*/
197-
#define pgoff_t __int64
197+
typedef __int64 pgoff_t;
198198

199199
#ifdef _MSC_VER
200200
extern int _pgfseeko64(FILE *stream, pgoff_t offset, int origin);

0 commit comments

Comments
 (0)