Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
In contrib/uuid-ossp, #include headers needed for ntohl() and ntohs().
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 18 Dec 2016 03:24:13 +0000 (22:24 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 18 Dec 2016 03:24:44 +0000 (22:24 -0500)
Oversight in commit b8cc8f947.  I just noticed this causes compiler
warnings on FreeBSD, and it really ought to cause warnings elsewhere too:
all references I can find say that <arpa/inet.h> is required for these.
We have a lot of code elsewhere that thinks that both <netinet/in.h>
and <arpa/inet.h> should be included for these functions, so do it that
way here too, even though <arpa/inet.h> ought to be sufficient according
to the references I consulted.

Back-patch to 9.4 where the previous commit landed.

contrib/uuid-ossp/uuid-ossp.c

index 9e9905bfdefb7a060bfd24fea3583e11a2379e9c..9bf30259114daf6e44e959575d7fa7a70a102efb 100644 (file)
 #include "utils/builtins.h"
 #include "utils/uuid.h"
 
+/* for ntohl/htonl */
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
 /*
  * It's possible that there's more than one uuid.h header file present.
  * We expect configure to set the HAVE_ symbol for only the one we want.