$NetBSD: patch-ae,v 1.1 2007/10/04 06:06:20 dmcmahill Exp $

--- event_rpcgen.py.orig	2007-08-02 11:23:05.000000000 -0400
+++ event_rpcgen.py
@@ -1295,8 +1295,14 @@ def HeaderPreamble(name):
         '#define %s\n\n' ) % (
         name, guard, guard)
 
-    # insert stdint.h - let's hope everyone has it
-    pre += '#include <stdint.h>\n'
+    pre += ('#include "config.h"\n'
+            '#ifdef HAVE_STDINT_H\n'
+            '#  include <stdint.h>\n'
+            '#elif defined(HAVE_INTTYPES_H)\n'
+            '#  include <inttypes.h>\n'
+            '#else\n'
+            '#  error No inttypes.h or stdint.h to give integer types\n'
+            '#endif\n' )
 
     for statement in headerdirect:
         pre += '%s\n' % statement
