]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix various header build issues in librfcnb
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 29 Sep 2013 20:14:10 +0000 (14:14 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 29 Sep 2013 20:14:10 +0000 (14:14 -0600)
Highlighted when the #include sorting was applied to lib/rfcnb/ files
several of the headers were using order-dependent definitions and were
not wrapped with sfety macros.

lib/rfcnb/rfcnb-common.h
lib/rfcnb/rfcnb-io.c
lib/rfcnb/rfcnb-io.h
lib/rfcnb/rfcnb-priv.h
lib/rfcnb/rfcnb-util.c
lib/rfcnb/rfcnb-util.h
lib/rfcnb/rfcnb.h
lib/rfcnb/session.c

index 9f5828f27d691eff4c07a4af969a1fce508d2bc0..1ab2be37e6d4133f5c3691ab2dc8a1aa30b8b4dd 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef _RFCNB_RFCNB_COMMON_H
 #define _RFCNB_RFCNB_COMMON_H
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 extern "C" {
 #endif
 
@@ -40,8 +40,7 @@ extern "C" {
 
     } RFCNB_Pkt;
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 }
-
 #endif
-#endif                          /* _RFCNB_RFCNB_COMMON_H */
+#endif /* _RFCNB_RFCNB_COMMON_H */
index 66beb302f4ad34e1a8d1f5ae6ed8d79f1ad48700..fea3b2829a12b0233dbf6edb53cdcc0ad8faee50 100644 (file)
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include "rfcnb/std-includes.h"
+#include "rfcnb/rfcnb-io.h"
 #include "rfcnb/rfcnb-priv.h"
 #include "rfcnb/rfcnb-util.h"
-#include "rfcnb/rfcnb-io.h"
+#include "rfcnb/std-includes.h"
 #include <sys/uio.h>
 #include <sys/signal.h>
 
index 6b54e86e0593c6530d15e89f34ebe16dead2e42f..3019b0223acf8d7d64702549d459ae2342844e8a 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _SQUID__LIB_RFCNB_RFCNB_IO_H
+#define _SQUID__LIB_RFCNB_RFCNB_IO_H
+
 /* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation
  *
  * Version 1.0
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+
+#include "rfcnb/rfcnb.h"
+
 int RFCNB_Put_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len);
 
 int RFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len);
+
+#endif
index 31e9ce7b929f089cce58b26a065332c751dd433c..cf65eb1a690e9af82f764b9ca2f6b3145b0b96f4 100644 (file)
@@ -32,9 +32,13 @@ typedef unsigned short uint16;
 
 #define GLOBAL extern
 
-#include "rfcnb/rfcnb-error.h"
-#include "rfcnb/rfcnb-common.h"
 #include "rfcnb/byteorder.h"
+#include "rfcnb/rfcnb-common.h"
+#include "rfcnb/rfcnb-error.h"
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
 
 #ifdef RFCNB_PORT
 #define RFCNB_Default_Port RFCNB_PORT
index eb6f29cec3c5c12c4b6e5fc5986d13f54882d753..2fd43489233d463ba403d3c8eb37ee10388d50f3 100644 (file)
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include "rfcnb/rfcnb.h"
-#include "rfcnb/std-includes.h"
+#include "rfcnb/rfcnb-io.h"
 #include "rfcnb/rfcnb-priv.h"
 #include "rfcnb/rfcnb-util.h"
-#include "rfcnb/rfcnb-io.h"
+#include "rfcnb/rfcnb.h"
+#include "rfcnb/std-includes.h"
 
 #if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
index adf9ffa8e681e77aff1c4a3a112161143f4a6377..270857bce68ac4216606ed7a5b48dcad387fb2e4 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _RFCNB_RFCNB_UTIL_H
+#define _RFCNB_RFCNB_UTIL_H
+
 /* UNIX RFCNB (RFC1001/RFC1002) NetBIOS implementation
  *
  * Version 1.0
@@ -23,6 +26,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "rfcnb/std-includes.h"
+
 void RFCNB_CvtPad_Name(char *name1, char *name2);
 
 void RFCNB_AName_To_NBName(char *AName, char *NBName);
@@ -48,3 +53,5 @@ int RFCNB_Session_Req(struct RFCNB_Con *con,
 
 typedef void RFCNB_Prot_Print_Routine(FILE * fd, int dir, struct RFCNB_Pkt *pkt, int header, int payload);
 extern RFCNB_Prot_Print_Routine *Prot_Print_Routine;
+
+#endif /* _RFCNB_RFCNB_UTIL_H */
index 1e4c3d9cb283522dc93babd39d9661af6e576e85..89cfb5787fcdab3cb14e0e2f1305b5d2448bac0d 100644 (file)
@@ -28,8 +28,8 @@
 
 /* Error responses */
 
-#include "rfcnb/rfcnb-error.h"
 #include "rfcnb/rfcnb-common.h"
+#include "rfcnb/rfcnb-error.h"
 
 #ifdef __cplusplus
 extern "C" {
index b2d4246ea55acc61c5c7b0fb9686f5334cfadaef..35ca1c2e42ca647b5be06644fad258d28143c25f 100644 (file)
@@ -31,10 +31,10 @@ int RFCNB_saved_errno = 0;
 
 #include "rfcnb/std-includes.h"
 #include <netinet/tcp.h>
-#include "rfcnb/rfcnb.h"
-#include "rfcnb/rfcnb-priv.h"
 #include "rfcnb/rfcnb-io.h"
+#include "rfcnb/rfcnb-priv.h"
 #include "rfcnb/rfcnb-util.h"
+#include "rfcnb/rfcnb.h"
 
 #if HAVE_STRING_H
 #include <string.h>