Add "extern C {...} to header files for C++ builds.
[freeradius.git] / src / include / libradius.h
index bbf5e79..5423583 100644 (file)
@@ -57,6 +57,10 @@ RCSIDH(libradius_h, "$Id$")
 #define WITH_TCP (1)
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define EAP_START               2
 
 #define AUTH_VECTOR_LEN                16
@@ -164,7 +168,16 @@ typedef struct value_pair {
        unsigned int            vendor;
        int                     type;
        size_t                  length; /* of data */
+#ifdef __cplusplus
+       /*
+        *      C++ hackery.  The server and modules are all C, so
+        *      the defs here don't affect them.  But any C++ code
+        *      gets excited over "operator", so we change the name.
+        */
+       FR_TOKEN                op_token;
+#else
        FR_TOKEN                operator;
+#endif
         ATTR_FLAGS              flags;
        struct value_pair       *next;
        uint32_t                lvalue;
@@ -483,6 +496,10 @@ void *fr_fifo_pop(fr_fifo_t *fi);
 void *fr_fifo_peek(fr_fifo_t *fi);
 int fr_fifo_num_elements(fr_fifo_t *fi);
 
+#ifdef __cplusplus
+}
+#endif
+
 #include <freeradius-devel/packet.h>
 
 #ifdef WITH_TCP