diff --git a/contrib/sepgsql/label.c b/contrib/sepgsql/label.c
index 1a8f884..5e2eba6 100644
*** a/contrib/sepgsql/label.c
--- b/contrib/sepgsql/label.c
***************
*** 10,15 ****
--- 10,25 ----
   */
  #include "postgres.h"
  
+ #include <selinux/label.h>
+ 
+ /*
+  * <selinux/label.h> includes <stdbool.h>, which creates an incompatible
+  * #define for bool.  Get rid of that so we can use our own typedef.
+  * (We don't care if <stdbool.h> redefines "true"/"false"; those are close
+  * enough.)
+  */
+ #undef bool
+ 
  #include "access/heapam.h"
  #include "access/htup_details.h"
  #include "access/genam.h"
***************
*** 37,44 ****
  
  #include "sepgsql.h"
  
- #include <selinux/label.h>
- 
  /*
   * Saved hook entries (if stacked)
   */
--- 47,52 ----
