dont-assume-cpuid-available.patch

text/x-patch

Filename: dont-assume-cpuid-available.patch
Type: text/x-patch
Part: 0
Message: Re: Broken build on macOS (Universal / Intel): cpuid instruction not available

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/port/pg_cpu_x86.c 1 2
diff --git a/src/port/pg_cpu_x86.c b/src/port/pg_cpu_x86.c
index f22167da9af..f61f0940431 100644
--- a/src/port/pg_cpu_x86.c
+++ b/src/port/pg_cpu_x86.c
@@ -63,12 +63,11 @@ mask_available(uint32 value, uint32 mask)
 static inline void
 pg_cpuid(int leaf, unsigned int *reg)
 {
+	memset(reg, 0, 4 * sizeof(unsigned int));
 #if defined(HAVE__GET_CPUID)
 	__get_cpuid(leaf, &reg[EAX], &reg[EBX], &reg[ECX], &reg[EDX]);
 #elif defined(HAVE__CPUID)
 	__cpuid((int *) reg, leaf);
-#else
-#error cpuid instruction not available
 #endif
 }