From a5dafa317756ab8e622c0eb4634444ecea6aac4e Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Tue, 2 Oct 2001 22:38:43 +0000
Subject: [PATCH] Tweak to test HAVE_GETOPT_H before including <getopt.h>, so
 as to build on systems without.

---
 contrib/oid2name/oid2name.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c
index 2bfb0a2a520..99352cc19c4 100644
--- a/contrib/oid2name/oid2name.c
+++ b/contrib/oid2name/oid2name.c
@@ -5,11 +5,12 @@
   b. palmer, bpalmer@crimelabs.net 1-17-2001
 
  */
+#include "postgres_fe.h"
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
+#ifdef HAVE_GETOPT_H
 #include <getopt.h>
+#endif
 
 #include "libpq-fe.h"
 
-- 
GitLab