Skip to content

Commit ff43b3e

Browse files
committed
Sync our DTrace infrastructure with c.h's definition of type bool.
Since commit d26a810, we've defined bool as being either _Bool from <stdbool.h>, or "unsigned char"; but that commit overlooked the fact that probes.d has "#define bool char". For consistency, make it say "unsigned char" instead. This should be strictly a cosmetic change, but it seems best to be in sync. Formally, in the now-normal case where we're using <stdbool.h>, it'd be better to write "#define bool _Bool". However, then we'd need some build infrastructure to inject that configuration choice into probes.d, and it doesn't seem worth the trouble. We only use <stdbool.h> if sizeof(_Bool) is 1, so having DTrace think that bool parameters are "unsigned char" should be close enough. Back-patch to v12 where d26a810 came in. Discussion: https://postgr.es/m/CAA4eK1LmaKO7Du9M9Lo=kxGU8sB6aL8fa3sF6z6d5yYYVe3BuQ@mail.gmail.com
1 parent d40abd5 commit ff43b3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/src/sgml/monitoring.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4638,7 +4638,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
46384638
</row>
46394639
<row>
46404640
<entry><type>bool</type></entry>
4641-
<entry><type>char</type></entry>
4641+
<entry><type>unsigned char</type></entry>
46424642
</row>
46434643

46444644
</tbody>

src/backend/utils/probes.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99

1010

1111
/*
12-
* Typedefs used in PostgreSQL.
12+
* Typedefs used in PostgreSQL probes.
1313
*
1414
* NOTE: Do not use system-provided typedefs (e.g. uintptr_t, uint32_t, etc)
15-
* in probe definitions, as they cause compilation errors on macOS 10.5.
15+
* in probe definitions, as they cause compilation errors on macOS.
1616
*/
1717
#define LocalTransactionId unsigned int
1818
#define LWLockMode int
1919
#define LOCKMODE int
2020
#define BlockNumber unsigned int
2121
#define Oid unsigned int
2222
#define ForkNumber int
23-
#define bool char
23+
#define bool unsigned char
2424

2525
provider postgresql {
2626

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