From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:04 +0000 (-0700) Subject: More C++ goodness X-Git-Tag: stable-10.2.0~525 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=76f7e0f43e95edb6cffe3dd5294ce2d4a65ff1cf;p=thirdparty%2Fopen-vm-tools.git More C++ goodness --- diff --git a/open-vm-tools/lib/include/vixCommands.h b/open-vm-tools/lib/include/vixCommands.h index b25ce416c..777738969 100644 --- a/open-vm-tools/lib/include/vixCommands.h +++ b/open-vm-tools/lib/include/vixCommands.h @@ -27,6 +27,10 @@ #include "vixOpenSource.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * These describe the format of the message objects. * This will change when the client/vmx support different @@ -2662,8 +2666,9 @@ __VMAutomationMsgParserGetPropertyList(const char *caller, #endif // VIX_HIDE_FROM_JAVA - - +#if defined(__cplusplus) +} // extern "C" +#endif #endif // _VIX_COMMANDS_H_ diff --git a/open-vm-tools/lib/include/vixOpenSource.h b/open-vm-tools/lib/include/vixOpenSource.h index f03cdfb7c..3c3cef222 100644 --- a/open-vm-tools/lib/include/vixOpenSource.h +++ b/open-vm-tools/lib/include/vixOpenSource.h @@ -30,8 +30,8 @@ #ifndef _VIXOpenSource_h_ #define _VIXOpenSource_h_ -#ifdef __cplusplus -extern "C"{ +#if defined(__cplusplus) +extern "C" { #endif /* @@ -766,11 +766,10 @@ extern VixError VixLogError(VixError err, const char *function, int line, #endif // VIX_HIDE_FROM_JAVA -#ifdef __cplusplus -} // extern "C" { +#if defined(__cplusplus) +} // extern "C" #endif - #endif // _VIXOpenSource_h_ diff --git a/open-vm-tools/lib/include/vmSessionId.h b/open-vm-tools/lib/include/vmSessionId.h index ec5146e71..99bd5bafc 100644 --- a/open-vm-tools/lib/include/vmSessionId.h +++ b/open-vm-tools/lib/include/vmSessionId.h @@ -19,17 +19,16 @@ #ifndef _VM_SESSION_ID_H_ #define _VM_SESSION_ID_H_ - #include "vm_basic_types.h" -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif typedef uint64 VMSessionId; -#ifdef __cplusplus -} +#if defined(__cplusplus) +} // extern "C" #endif #endif /* _VM_SESSION_ID_H_ */ diff --git a/open-vm-tools/lib/include/vmblock.h b/open-vm-tools/lib/include/vmblock.h index 2c9be1613..a8631bd94 100644 --- a/open-vm-tools/lib/include/vmblock.h +++ b/open-vm-tools/lib/include/vmblock.h @@ -91,6 +91,9 @@ # include #endif +#if defined(__cplusplus) +extern "C" { +#endif /* * FUSE definitions. They are supposed to be used by userspace code and @@ -202,4 +205,8 @@ # error "Unknown platform for vmblock." #endif +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _VMBLOCK_H_ */ diff --git a/open-vm-tools/lib/include/vmblock_user.h b/open-vm-tools/lib/include/vmblock_user.h index dab81658c..cc7cf6607 100644 --- a/open-vm-tools/lib/include/vmblock_user.h +++ b/open-vm-tools/lib/include/vmblock_user.h @@ -68,6 +68,10 @@ #include "vm_basic_types.h" #include "vmblock.h" +#if defined(__cplusplus) +extern "C" { +#endif + static INLINE int VMBLOCK_CONTROL_FUSE(int fd, // IN char op, // IN @@ -159,4 +163,8 @@ VMBLOCK_CONTROL(int fd, int cmd, const char *path) #endif +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // _VMBLOCK_USER_H_ diff --git a/open-vm-tools/lib/include/vmfs.h b/open-vm-tools/lib/include/vmfs.h index 64bf31013..23265072c 100644 --- a/open-vm-tools/lib/include/vmfs.h +++ b/open-vm-tools/lib/include/vmfs.h @@ -1,4 +1,3 @@ - /********************************************************* * Copyright (C) 2003-2016 VMware, Inc. All rights reserved. * @@ -32,6 +31,10 @@ #include "unicodeTypes.h" +#if defined(__cplusplus) +extern "C" { +#endif + // Consolidate all path stuff here so it's consistent between user and kernel #define VMFS_ROOT_DIR_NAME "vmfs" #define VMFS_ROOT_DIR_PATH "/vmfs/" @@ -109,5 +112,9 @@ typedef enum { char *Vmfs_GetCOSFileName(const char *vmfsFile); #endif /* VM86_SERVER */ +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* __VMFS_H__ */ diff --git a/open-vm-tools/lib/include/vmstdio.h b/open-vm-tools/lib/include/vmstdio.h index 646b7fa75..ece66d7ed 100644 --- a/open-vm-tools/lib/include/vmstdio.h +++ b/open-vm-tools/lib/include/vmstdio.h @@ -27,6 +27,10 @@ #include +#if defined(__cplusplus) +extern "C" { +#endif + typedef enum { StdIO_Error, StdIO_EOF, @@ -40,5 +44,8 @@ StdIO_ReadNextLine(FILE *stream, // IN size_t maxBufLength, // IN size_t *count); // OUT +#if defined(__cplusplus) +} // extern "C" +#endif #endif /* __VMSTDIO_H__ */ diff --git a/open-vm-tools/lib/include/vmsupport.h b/open-vm-tools/lib/include/vmsupport.h index 5393b36f9..2d3703192 100644 --- a/open-vm-tools/lib/include/vmsupport.h +++ b/open-vm-tools/lib/include/vmsupport.h @@ -26,6 +26,10 @@ #ifndef _VMSUPPORT_H_ #define _VMSUPPORT_H_ +#if defined(__cplusplus) +extern "C" { +#endif + /* * The status of vm-support tool running in the guest, exported in VMDB at: * vm/#/vmx/guestTools/vmsupport/gStatus @@ -55,4 +59,8 @@ typedef enum { #define RPC_VMSUPPORT_START "vmsupport.start" #define RPC_VMSUPPORT_STATUS "tools.vmsupport.status" +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // _VMSUPPORT_H_ diff --git a/open-vm-tools/lib/include/vmxrpc.h b/open-vm-tools/lib/include/vmxrpc.h index 0940ebfd1..6bf4da91a 100644 --- a/open-vm-tools/lib/include/vmxrpc.h +++ b/open-vm-tools/lib/include/vmxrpc.h @@ -30,6 +30,10 @@ #include #include "vm_basic_types.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * glibc and Solaris headers seem to define functions for unsigned types with * slightly different names than all other platforms. Provide macros to @@ -264,5 +268,9 @@ xdr_Bool(XDR *xdrs, // IN } #endif +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _VMXRPC_H_ */ diff --git a/open-vm-tools/lib/include/vthreadBase.h b/open-vm-tools/lib/include/vthreadBase.h index 5f6ece0d1..099ea59e7 100644 --- a/open-vm-tools/lib/include/vthreadBase.h +++ b/open-vm-tools/lib/include/vthreadBase.h @@ -31,7 +31,6 @@ #define VTHREAD_BASE_H #define INCLUDE_ALLOW_USERLEVEL - #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" @@ -42,6 +41,9 @@ #include #endif +#if defined(__cplusplus) +extern "C" { +#endif /* * Types @@ -154,5 +156,8 @@ void VThreadBase_SetIsInSignal(VThreadID tid, Bool isInSignal); #endif /* VMM */ +#if defined(__cplusplus) +} // extern "C" +#endif #endif // VTHREAD_BASE_H diff --git a/open-vm-tools/lib/include/xdrutil.h b/open-vm-tools/lib/include/xdrutil.h index 55fb4ea26..6b6531d99 100644 --- a/open-vm-tools/lib/include/xdrutil.h +++ b/open-vm-tools/lib/include/xdrutil.h @@ -29,6 +29,10 @@ #include "vm_basic_types.h" #include "util.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * Helper macros for iterating over an rpcgen-generated array. Given a struct S: * @@ -123,5 +127,9 @@ XdrUtil_ArrayAppend(void **array, u_int *arrayLen, size_t elemSz, u_int elemCnt) Bool XdrUtil_Deserialize(const void *data, size_t dataLen, void *xdrProc, void *dest); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _XDRUTIL_H_ */ diff --git a/open-vm-tools/libguestlib/vmGuestLibInt.h b/open-vm-tools/libguestlib/vmGuestLibInt.h index d97951dc2..f7e2b786a 100644 --- a/open-vm-tools/libguestlib/vmGuestLibInt.h +++ b/open-vm-tools/libguestlib/vmGuestLibInt.h @@ -16,7 +16,6 @@ * *********************************************************/ - #ifndef _VM_GUEST_LIB_INT_H_ #define _VM_GUEST_LIB_INT_H_ @@ -26,6 +25,9 @@ #include "vmware.h" #include "vmGuestLib.h" +#if defined(__cplusplus) +extern "C" { +#endif /* * Backdoor string for retrieving guestlib info @@ -210,4 +212,8 @@ struct VMGuestLibDataV3 { #include "vmware_pack_end.h" VMGuestLibDataV3; +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _VM_GUEST_LIB_INT_H_ */