diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/include/c.h | 18 | ||||
| -rw-r--r-- | src/include/storage/fd.h | 5 |
2 files changed, 6 insertions, 17 deletions
diff --git a/src/include/c.h b/src/include/c.h index 729eb8a27de..a40f0cf4642 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -1132,25 +1132,15 @@ typedef struct PGAlignedBlock * for I/O in general, but may be strictly required on some platforms when * using direct I/O. */ -typedef union PGIOAlignedBlock +typedef struct PGIOAlignedBlock { -#ifdef pg_attribute_aligned - pg_attribute_aligned(PG_IO_ALIGN_SIZE) -#endif - char data[BLCKSZ]; - double force_align_d; - int64 force_align_i64; + alignas(PG_IO_ALIGN_SIZE) char data[BLCKSZ]; } PGIOAlignedBlock; /* Same, but for an XLOG_BLCKSZ-sized buffer */ -typedef union PGAlignedXLogBlock +typedef struct PGAlignedXLogBlock { -#ifdef pg_attribute_aligned - pg_attribute_aligned(PG_IO_ALIGN_SIZE) -#endif - char data[XLOG_BLCKSZ]; - double force_align_d; - int64 force_align_i64; + alignas(PG_IO_ALIGN_SIZE) char data[XLOG_BLCKSZ]; } PGAlignedXLogBlock; /* msb for char */ diff --git a/src/include/storage/fd.h b/src/include/storage/fd.h index 3e821ce8fb7..a1bdefec4a5 100644 --- a/src/include/storage/fd.h +++ b/src/include/storage/fd.h @@ -85,10 +85,9 @@ extern PGDLLIMPORT int max_safe_fds; * to the appropriate Windows flag in src/port/open.c. We simulate it with * fcntl(F_NOCACHE) on macOS inside fd.c's open() wrapper. We use the name * PG_O_DIRECT rather than defining O_DIRECT in that case (probably not a good - * idea on a Unix). We can only use it if the compiler will correctly align - * PGIOAlignedBlock for us, though. + * idea on a Unix). */ -#if defined(O_DIRECT) && defined(pg_attribute_aligned) +#if defined(O_DIRECT) #define PG_O_DIRECT O_DIRECT #elif defined(F_NOCACHE) #define PG_O_DIRECT 0x80000000 |
