diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-11-06 11:11:40 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-11-06 11:11:40 -0500 |
commit | ff43b3e88eceb94b3a2b2579e8510e4f3aedbe09 (patch) | |
tree | c6a5bab0a2fd877bc27769376e9c345c8cd466af | |
parent | d40abd5fcfb25d764419f8e9bffa5cdbdb247c1b (diff) | |
download | postgresql-ff43b3e88eceb94b3a2b2579e8510e4f3aedbe09.tar.gz postgresql-ff43b3e88eceb94b3a2b2579e8510e4f3aedbe09.zip |
Sync our DTrace infrastructure with c.h's definition of type bool.
Since commit d26a810eb, 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 d26a810eb came in.
Discussion: https://postgr.es/m/CAA4eK1LmaKO7Du9M9Lo=kxGU8sB6aL8fa3sF6z6d5yYYVe3BuQ@mail.gmail.com
-rw-r--r-- | doc/src/sgml/monitoring.sgml | 2 | ||||
-rw-r--r-- | src/backend/utils/probes.d | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index e6c49eebade..d18b271a58d 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -4638,7 +4638,7 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid, </row> <row> <entry><type>bool</type></entry> - <entry><type>char</type></entry> + <entry><type>unsigned char</type></entry> </row> </tbody> diff --git a/src/backend/utils/probes.d b/src/backend/utils/probes.d index 33ac627799c..f08a49c9dd2 100644 --- a/src/backend/utils/probes.d +++ b/src/backend/utils/probes.d @@ -9,10 +9,10 @@ /* - * Typedefs used in PostgreSQL. + * Typedefs used in PostgreSQL probes. * * NOTE: Do not use system-provided typedefs (e.g. uintptr_t, uint32_t, etc) - * in probe definitions, as they cause compilation errors on macOS 10.5. + * in probe definitions, as they cause compilation errors on macOS. */ #define LocalTransactionId unsigned int #define LWLockMode int @@ -20,7 +20,7 @@ #define BlockNumber unsigned int #define Oid unsigned int #define ForkNumber int -#define bool char +#define bool unsigned char provider postgresql { |