Add "extern C {...} to header files for C++ builds.
[freeradius.git] / src / include / udpfromto.h
index b93c8a3..525df38 100644 (file)
@@ -8,8 +8,14 @@
 #include <freeradius-devel/ident.h>
 RCSIDH(udpfromtoh, "$Id$")
 
-#include <sys/socket.h>
+#include <freeradius-devel/autoconf.h>
+#include <freeradius-devel/libradius.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef WITH_UDPFROMTO
 int udpfromto_init(int s);
 int recvfromto(int s, void *buf, size_t len, int flags,
               struct sockaddr *from, socklen_t *fromlen,
@@ -17,5 +23,10 @@ int recvfromto(int s, void *buf, size_t len, int flags,
 int sendfromto(int s, void *buf, size_t len, int flags,
               struct sockaddr *from, socklen_t fromlen,
               struct sockaddr *to, socklen_t tolen);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif