From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:04 +0000 (-0700) Subject: More C++ happiness X-Git-Tag: stable-10.2.0~530 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9f7cd4aae81fef9fbcaf72c1b8c45c1e4ef084d;p=thirdparty%2Fopen-vm-tools.git More C++ happiness Add extern "C" to header files. --- diff --git a/open-vm-tools/lib/include/dbllnklst.h b/open-vm-tools/lib/include/dbllnklst.h index 2bec9eb43..df8e9ce13 100644 --- a/open-vm-tools/lib/include/dbllnklst.h +++ b/open-vm-tools/lib/include/dbllnklst.h @@ -70,6 +70,10 @@ #include "vm_basic_types.h" +#if defined(__cplusplus) +extern "C" { +#endif + #define DblLnkLst_OffsetOf(type, field) ((intptr_t)&((type *)0)->field) #define DblLnkLst_Container(addr, type, field) \ @@ -325,5 +329,8 @@ DblLnkLst_Swap(DblLnkLst_Links *head1, // IN/OUT } } +#if defined(__cplusplus) +} // extern "C" +#endif #endif /* _DBLLNKLST_H_ */ diff --git a/open-vm-tools/lib/include/dictll.h b/open-vm-tools/lib/include/dictll.h index 3f0201822..a51d57bcc 100644 --- a/open-vm-tools/lib/include/dictll.h +++ b/open-vm-tools/lib/include/dictll.h @@ -25,10 +25,13 @@ #ifndef __DICTLL_H__ # define __DICTLL_H__ - #include "vm_basic_types.h" #include "dynbuf.h" +#if defined(__cplusplus) +extern "C" { +#endif + int DictLL_ReadLine(FILE *stream, // IN char **line, // OUT @@ -56,5 +59,8 @@ DictLL_MarshalLine(DynBuf *output, // IN/OUT Bool DictLL_ReadUTF8BOM(FILE *file); // IN/OUT +#if defined(__cplusplus) +} // extern "C" +#endif #endif /* __DICTLL_H__ */ diff --git a/open-vm-tools/lib/include/dynarray.h b/open-vm-tools/lib/include/dynarray.h index 154795e2e..2a75af2df 100644 --- a/open-vm-tools/lib/include/dynarray.h +++ b/open-vm-tools/lib/include/dynarray.h @@ -32,6 +32,9 @@ #include "vm_basic_types.h" #include "vm_assert.h" +#if defined(__cplusplus) +extern "C" { +#endif typedef struct DynArray { DynBuf buf; @@ -338,4 +341,8 @@ DynArray_Copy(DynArray *src, // IN /* Define DynArray of DynBuf. */ DEFINE_DYNARRAY_TYPE(DynBuf) +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _DYNARRAY_H_ */ diff --git a/open-vm-tools/lib/include/dynbuf.h b/open-vm-tools/lib/include/dynbuf.h index eb4e99162..b5f933b82 100644 --- a/open-vm-tools/lib/include/dynbuf.h +++ b/open-vm-tools/lib/include/dynbuf.h @@ -29,6 +29,9 @@ #include "vm_basic_types.h" #include "vm_assert.h" +#if defined(__cplusplus) +extern "C" { +#endif typedef struct DynBuf { char *data; @@ -237,5 +240,8 @@ DynBuf_AppendString(DynBuf *buf, // IN/OUT return DynBuf_Append(buf, string, strlen(string) + 1); } +#if defined(__cplusplus) +} // extern "C" +#endif #endif /* __DYNBUF_H__ */ diff --git a/open-vm-tools/lib/include/dynxdr.h b/open-vm-tools/lib/include/dynxdr.h index 5410375cf..53587d4b3 100644 --- a/open-vm-tools/lib/include/dynxdr.h +++ b/open-vm-tools/lib/include/dynxdr.h @@ -38,11 +38,19 @@ #include #include "vm_basic_types.h" +#if defined(__cplusplus) +extern "C" { +#endif + XDR *DynXdr_Create(XDR *in); Bool DynXdr_AppendRaw(XDR *xdrs, const void *buf, size_t len); void *DynXdr_AllocGet(XDR *xdrs); void *DynXdr_Get(XDR *xdrs); void DynXdr_Destroy(XDR *xdrs, Bool release); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _DYNXDR_H_ */ diff --git a/open-vm-tools/lib/include/err.h b/open-vm-tools/lib/include/err.h index 49bc5a0bc..a28487dab 100644 --- a/open-vm-tools/lib/include/err.h +++ b/open-vm-tools/lib/include/err.h @@ -25,19 +25,18 @@ #ifndef _ERR_H_ #define _ERR_H_ -#if !defined(_WIN32) -#include -#endif - #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" - #if defined(__cplusplus) extern "C" { #endif +#if !defined(_WIN32) +#include +#endif + #if defined(_WIN32) typedef DWORD Err_Number; #else @@ -129,8 +128,8 @@ char *Err_SanitizeMessage(const char *msg); Err_SetErrno(e); \ } while (FALSE) -#ifdef __cplusplus -} +#if defined(__cplusplus) +} // extern "C" #endif #endif diff --git a/open-vm-tools/lib/include/escape.h b/open-vm-tools/lib/include/escape.h index ee81d95cb..3b478681e 100644 --- a/open-vm-tools/lib/include/escape.h +++ b/open-vm-tools/lib/include/escape.h @@ -27,6 +27,10 @@ #include "vmware.h" +#if defined(__cplusplus) +extern "C" { +#endif + void * Escape_DoString(const char *escStr, // IN int const *bytesToEsc, // IN @@ -84,5 +88,8 @@ Escape_UnescapeCString(char *buf); // IN/OUT char * Escape_Comma(const char *string); // IN +#if defined(__cplusplus) +} // extern "C" +#endif #endif /* __ESCAPE_H__ */ diff --git a/open-vm-tools/lib/include/file.h b/open-vm-tools/lib/include/file.h index 05f91f248..b714ebaf4 100644 --- a/open-vm-tools/lib/include/file.h +++ b/open-vm-tools/lib/include/file.h @@ -25,15 +25,12 @@ #ifndef _FILE_H_ #define _FILE_H_ -#ifdef __cplusplus -extern "C"{ -#endif - -#include #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" +#include + #include "fileIO.h" #include "unicodeTypes.h" #include "err.h" @@ -52,6 +49,10 @@ extern "C"{ #define FILE_MAXPATH PATH_MAX #endif +#if defined(__cplusplus) +extern "C" { +#endif + #define FILE_SEARCHPATHTOKEN ";" @@ -406,8 +407,8 @@ int File_MakeSafeTemp(const char *tag, Bool File_DoesVolumeSupportAcls(const char *pathName); -#ifdef __cplusplus -} // extern "C" { +#if defined(__cplusplus) +} // extern "C" #endif #endif // ifndef _FILE_H_ diff --git a/open-vm-tools/lib/include/fileIO.h b/open-vm-tools/lib/include/fileIO.h index 0dcda432b..889ef23d3 100644 --- a/open-vm-tools/lib/include/fileIO.h +++ b/open-vm-tools/lib/include/fileIO.h @@ -36,10 +36,6 @@ #ifndef _FILEIO_H_ #define _FILEIO_H_ -#ifdef __cplusplus -extern "C"{ -#endif - #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" @@ -56,6 +52,10 @@ extern "C"{ #include "iovector.h" // for struct iovec +#if defined(__cplusplus) +extern "C" { +#endif + struct FileLockToken; #if defined(_WIN32) @@ -484,8 +484,8 @@ Bool FileIO_IsSuccess(FileIOResult res); Bool FileIO_SupportsPrealloc(const char *pathName, Bool fsCheck); -#ifdef __cplusplus -} // extern "C" { +#if defined(__cplusplus) +} // extern "C" #endif #endif // _FILEIO_H_ diff --git a/open-vm-tools/lib/include/fileLock.h b/open-vm-tools/lib/include/fileLock.h index 5317ae6c1..185a6e48a 100644 --- a/open-vm-tools/lib/include/fileLock.h +++ b/open-vm-tools/lib/include/fileLock.h @@ -31,6 +31,10 @@ #include "unicodeTypes.h" #include "msgList.h" +#if defined(__cplusplus) +extern "C" { +#endif + // The default time, in msec, to wait for a lock before giving up #define FILELOCK_DEFAULT_WAIT 2500 @@ -78,4 +82,8 @@ Bool FileLock_CleanupVM(const char *cfgfilePath, int FileLock_LockDevice(const char *device); Bool FileLock_UnlockDevice(const char *device); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // ifndef _FILELOCK_H_ diff --git a/open-vm-tools/lib/include/glibUtils.h b/open-vm-tools/lib/include/glibUtils.h index f6268f771..bf0ecf1a0 100644 --- a/open-vm-tools/lib/include/glibUtils.h +++ b/open-vm-tools/lib/include/glibUtils.h @@ -19,6 +19,10 @@ #ifndef _GLIBUTILS_H_ #define _GLIBUTILS_H_ +#if defined(__cplusplus) +extern "C" { +#endif + /** * @file glibUtils.h * @@ -82,4 +86,8 @@ GlibUtils_CreateSysLogger(const char *domain, #endif +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _GLIBUTILS_H_ */ diff --git a/open-vm-tools/lib/include/hashMap.h b/open-vm-tools/lib/include/hashMap.h index bb75d32db..a189d34e3 100644 --- a/open-vm-tools/lib/include/hashMap.h +++ b/open-vm-tools/lib/include/hashMap.h @@ -38,12 +38,11 @@ #include "aioMgr.h" #endif -typedef struct HashMap HashMap; - -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif +typedef struct HashMap HashMap; /* * ---------------------------------------------------------------------------- @@ -79,8 +78,8 @@ void HashMap_Iterate(HashMap* map, HashMapIteratorFn mapFn, Bool clear, void *userData); Bool HashMap_DoTests(void); -#ifdef __cplusplus -} +#if defined(__cplusplus) +} // extern "C" #endif #endif /* _HASHMAP_H_ */ diff --git a/open-vm-tools/lib/include/hashTable.h b/open-vm-tools/lib/include/hashTable.h index 95a025f83..bc24b53d1 100644 --- a/open-vm-tools/lib/include/hashTable.h +++ b/open-vm-tools/lib/include/hashTable.h @@ -33,6 +33,9 @@ #include "vm_basic_defs.h" #include "vm_atomic.h" +#if defined(__cplusplus) +extern "C" { +#endif typedef struct HashTable HashTable; typedef struct PtrHashTable PtrHashTable; @@ -177,4 +180,8 @@ Bool PtrHash_Insert(PtrHashTable *hashTable, Bool PtrHash_Delete(PtrHashTable *hashTable, const void *keyPtr); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif diff --git a/open-vm-tools/lib/include/hgfsServer.h b/open-vm-tools/lib/include/hgfsServer.h index fbaf1314f..abf69c64a 100644 --- a/open-vm-tools/lib/include/hgfsServer.h +++ b/open-vm-tools/lib/include/hgfsServer.h @@ -22,6 +22,10 @@ #include "hgfs.h" /* for HGFS_PACKET_MAX */ #include "dbllnklst.h" +#if defined(__cplusplus) +extern "C" { +#endif + typedef struct HgfsVmxIov { void *va; /* Virtual addr */ uint64 pa; /* Physical address passed by the guest */ @@ -209,4 +213,8 @@ void HgfsServer_SetHandleCounter(uint32 newHandleCounter); void HgfsServer_Quiesce(Bool freeze); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // _HGFS_SERVER_H_ diff --git a/open-vm-tools/lib/include/hgfsServerManager.h b/open-vm-tools/lib/include/hgfsServerManager.h index 6a78921f2..87c3b7616 100644 --- a/open-vm-tools/lib/include/hgfsServerManager.h +++ b/open-vm-tools/lib/include/hgfsServerManager.h @@ -19,6 +19,10 @@ #ifndef _HGFS_SERVER_MANAGER_H_ # define _HGFS_SERVER_MANAGER_H_ +#if defined(__cplusplus) +extern "C" { +#endif + /* * hgfsServerManager.h -- * @@ -63,4 +67,8 @@ Bool HgfsServerManager_ProcessPacket(HgfsServerMgrData *mgrData, uint32 HgfsServerManager_InvalidateInactiveSessions(HgfsServerMgrData *mgrData); #endif +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // _HGFS_SERVER_MANAGER_H_ diff --git a/open-vm-tools/lib/include/hgfsServerPolicy.h b/open-vm-tools/lib/include/hgfsServerPolicy.h index 4a5e6fbb5..e84c403d9 100644 --- a/open-vm-tools/lib/include/hgfsServerPolicy.h +++ b/open-vm-tools/lib/include/hgfsServerPolicy.h @@ -25,6 +25,10 @@ #include "cpName.h" #include "hgfsServer.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * Name of share that corresponds to the root of the server's * filesystem. @@ -112,4 +116,8 @@ HgfsServerPolicy_FreeShareList(HgfsServerPolicy_ShareList *shareList); // IN: li HgfsServerPolicy_ShareList * HgfsServerPolicy_GetSharesWithTag(const char *tag); // IN: tag to search for +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // _HGFS_SERVER_POLICY_H_ diff --git a/open-vm-tools/lib/include/hostType.h b/open-vm-tools/lib/include/hostType.h index 69b6bae53..22cc4ea41 100644 --- a/open-vm-tools/lib/include/hostType.h +++ b/open-vm-tools/lib/include/hostType.h @@ -33,12 +33,22 @@ #include "vm_basic_types.h" +#if defined(__cplusplus) +extern "C" { +#endif + Bool HostType_OSIsVMK(void); Bool HostType_OSIsSimulator(void); /* Old name. TODO: remove */ static INLINE Bool HostType_OSIsPureVMK(void) -{ return HostType_OSIsVMK(); } +{ + return HostType_OSIsVMK(); +} + +#if defined(__cplusplus) +} // extern "C" +#endif #endif /* ifndef _HOSTTYPE_H_ */ diff --git a/open-vm-tools/lib/include/hostinfo.h b/open-vm-tools/lib/include/hostinfo.h index 199f10831..64cdc2848 100644 --- a/open-vm-tools/lib/include/hostinfo.h +++ b/open-vm-tools/lib/include/hostinfo.h @@ -35,6 +35,10 @@ #include "x86cpuid.h" #include "unicodeTypes.h" +#if defined(__cplusplus) +extern "C" { +#endif + typedef enum { HOSTINFO_PROCESS_QUERY_DEAD, // Procss is dead (does not exist) HOSTINFO_PROCESS_QUERY_ALIVE, // Process is alive (does exist) @@ -236,4 +240,8 @@ size_t Hostinfo_GetKernelZoneElemSize(char const *name); char *Hostinfo_GetHardwareModel(void); #endif +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* ifndef _HOSTINFO_H_ */ diff --git a/open-vm-tools/lib/include/impersonate.h b/open-vm-tools/lib/include/impersonate.h index 59a0661a6..7dcdba35e 100644 --- a/open-vm-tools/lib/include/impersonate.h +++ b/open-vm-tools/lib/include/impersonate.h @@ -28,23 +28,32 @@ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" + #include "auth.h" -extern void Impersonate_Init(void); +#if defined(__cplusplus) +extern "C" { +#endif + +void Impersonate_Init(void); -extern Bool Impersonate_Owner(const char *file); -extern Bool Impersonate_Do(const char *user, AuthToken token); -extern Bool Impersonate_Undo(void); -extern char *Impersonate_Who(void); +Bool Impersonate_Owner(const char *file); +Bool Impersonate_Do(const char *user, AuthToken token); +Bool Impersonate_Undo(void); +char *Impersonate_Who(void); -extern Bool Impersonate_ForceRoot(void); -extern Bool Impersonate_UnforceRoot(void); +Bool Impersonate_ForceRoot(void); +Bool Impersonate_UnforceRoot(void); -extern Bool Impersonate_Runas(const char *cfg, const char *caller, - AuthToken callerToken); +Bool Impersonate_Runas(const char *cfg, const char *caller, + AuthToken callerToken); #ifdef _WIN32 -extern Bool Impersonate_CfgRunasOnly(const char *cfg); +Bool Impersonate_CfgRunasOnly(const char *cfg); +#endif + +#if defined(__cplusplus) +} // extern "C" #endif #endif // ifndef _IMPERSONATE_H_ diff --git a/open-vm-tools/lib/include/ioplGet.h b/open-vm-tools/lib/include/ioplGet.h index 68015ac03..4c55dcf46 100644 --- a/open-vm-tools/lib/include/ioplGet.h +++ b/open-vm-tools/lib/include/ioplGet.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2012 VMware, Inc. All rights reserved. + * Copyright (C) 2012-2016 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -29,6 +29,14 @@ #include "x86_basic_defs.h" #include "vm_basic_asm.h" +#if defined(__cplusplus) +extern "C" { +#endif + #define Iopl_Get() ((GetCallerEFlags() >> EFLAGS_IOPL_SHIFT) && 0x3) +#if defined(__cplusplus) +} // extern "C" +#endif + #endif diff --git a/open-vm-tools/lib/include/iovector.h b/open-vm-tools/lib/include/iovector.h index 8a9a7a8bb..6f02b9491 100644 --- a/open-vm-tools/lib/include/iovector.h +++ b/open-vm-tools/lib/include/iovector.h @@ -29,6 +29,10 @@ #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * Ugly definition of struct iovec. */ @@ -139,4 +143,8 @@ void IOV_Assert(struct iovec *iov, // IN: iovector #define IOV_ASSERT(IOVEC, NUM_ENTRIES) ((void) 0) #endif +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* #ifndef _IOVECTOR_H_ */ diff --git a/open-vm-tools/lib/include/localconfig.h b/open-vm-tools/lib/include/localconfig.h index 94d5944c5..db08658d8 100644 --- a/open-vm-tools/lib/include/localconfig.h +++ b/open-vm-tools/lib/include/localconfig.h @@ -25,10 +25,18 @@ #include "preference.h" +#if defined(__cplusplus) +extern "C" { +#endif + #define LocalConfig_GetBool Preference_GetBool #define LocalConfig_GetTriState Preference_GetTriState #define LocalConfig_GetLong Preference_GetLong #define LocalConfig_GetString Preference_GetString #define LocalConfig_GetPathName Preference_GetPathName +#if defined(__cplusplus) +} // extern "C" +#endif + #endif diff --git a/open-vm-tools/lib/include/log.h b/open-vm-tools/lib/include/log.h index 94e39d2a6..51c2425b2 100644 --- a/open-vm-tools/lib/include/log.h +++ b/open-vm-tools/lib/include/log.h @@ -21,12 +21,15 @@ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE - #include "includeCheck.h" -#include "productState.h" +#include "productState.h" #include +#if defined(__cplusplus) +extern "C" { +#endif + /* * The bora/lib Log Facility log level model. @@ -392,4 +395,9 @@ void Log_Histogram(uint32 n, int limit); #endif /* !VMM */ + +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* VMWARE_LOG_H */ diff --git a/open-vm-tools/lib/include/logFixed.h b/open-vm-tools/lib/include/logFixed.h index 6cfd0242d..c68981cf3 100644 --- a/open-vm-tools/lib/include/logFixed.h +++ b/open-vm-tools/lib/include/logFixed.h @@ -23,6 +23,10 @@ #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * LogFixed_Base2 and LogFixed_Base10 provide their values expressed * as a ration of two uint32 numbers with an accuracy of better than 1%. @@ -39,4 +43,8 @@ void LogFixed_Base10(uint64 value, uint32 *numerator, uint32 *denominator); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // _LOGFIXED_H_ diff --git a/open-vm-tools/lib/include/memaligned.h b/open-vm-tools/lib/include/memaligned.h index a72248eb7..61409f5d3 100644 --- a/open-vm-tools/lib/include/memaligned.h +++ b/open-vm-tools/lib/include/memaligned.h @@ -35,6 +35,10 @@ #endif #include "vmware.h" +#if defined(__cplusplus) +extern "C" { +#endif + #if defined __APPLE__ && !vm_x86_64 /* * Bug 471584: Mac OS X 10.6's valloc() implementation for 32-bit @@ -381,4 +385,8 @@ Aligned_Realloc(void *buf, // IN #endif } +#if defined(__cplusplus) +} // extern "C" +#endif + #endif diff --git a/open-vm-tools/lib/include/miscSolaris.h b/open-vm-tools/lib/include/miscSolaris.h index 24ed3ac53..cc2e52c06 100644 --- a/open-vm-tools/lib/include/miscSolaris.h +++ b/open-vm-tools/lib/include/miscSolaris.h @@ -31,9 +31,17 @@ #define INCLUDE_ALLOW_USERLEVEL +#if defined(__cplusplus) +extern "C" { +#endif + int daemon(int nochdir, int noclose); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _MISCSOLARIS_H_ */ diff --git a/open-vm-tools/lib/include/msg.h b/open-vm-tools/lib/include/msg.h index a196bf6b2..44abe0e90 100644 --- a/open-vm-tools/lib/include/msg.h +++ b/open-vm-tools/lib/include/msg.h @@ -40,6 +40,10 @@ #include "voblib.h" #endif +#if defined(__cplusplus) +extern "C" { +#endif + #define INVALID_MSG_CODE (-1) @@ -267,4 +271,8 @@ void Msg_GetThreadCallback(MsgCallback *cb); const char *Msg_HResult2String(long hr); #endif +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // ifndef _MSG_H_ diff --git a/open-vm-tools/lib/include/msgList.h b/open-vm-tools/lib/include/msgList.h index 4e4450288..de0851580 100644 --- a/open-vm-tools/lib/include/msgList.h +++ b/open-vm-tools/lib/include/msgList.h @@ -35,6 +35,10 @@ #include "msgid.h" #include "msgfmt.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * Data structures, types, and constants @@ -72,4 +76,8 @@ const char *MsgList_GetMsgID(const MsgList *messages); Bool MsgList_Present(const MsgList *messages); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // ifndef _MSGLIST_H_ diff --git a/open-vm-tools/lib/include/msgfmt.h b/open-vm-tools/lib/include/msgfmt.h index b31ddbf06..cf2f0bbdc 100644 --- a/open-vm-tools/lib/include/msgfmt.h +++ b/open-vm-tools/lib/include/msgfmt.h @@ -34,6 +34,10 @@ #include "str.h" // for HAS_BSD_PRINTF #endif +#if defined(__cplusplus) +extern "C" { +#endif + /* * Format parser callback functions @@ -181,5 +185,8 @@ int MsgFmt_Snprintf(char *buf, size_t size, const char *format, char *MsgFmt_Asprintf(size_t *length, const char *format, const MsgFmt_Arg *args, int numArgs); +#if defined(__cplusplus) +} // extern "C" +#endif #endif // ifndef _MSGFMT_H_ diff --git a/open-vm-tools/lib/include/msgid.h b/open-vm-tools/lib/include/msgid.h index 3ef2bf150..8e1eb257d 100644 --- a/open-vm-tools/lib/include/msgid.h +++ b/open-vm-tools/lib/include/msgid.h @@ -29,14 +29,18 @@ #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" -#include "msgid_defs.h" +#include "msgid_defs.h" #include "vm_basic_defs.h" #ifndef VMKERNEL #include #endif +#if defined(__cplusplus) +extern "C" { +#endif + // the X hides MSG_MAGIC so it won't appear in the object file #define MSG_MAGICAL(s) \ @@ -104,5 +108,8 @@ Msg_StripMSGID(const char *idString) // IN return idString; } +#if defined(__cplusplus) +} // extern "C" +#endif #endif // ifndef _MSGID_H_ diff --git a/open-vm-tools/lib/include/mutexRank.h b/open-vm-tools/lib/include/mutexRank.h index 1d7eb03a7..2a1817cc5 100644 --- a/open-vm-tools/lib/include/mutexRank.h +++ b/open-vm-tools/lib/include/mutexRank.h @@ -27,9 +27,12 @@ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE - #include "includeCheck.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * Core rank defines. * @@ -100,4 +103,8 @@ */ #define RANK_libLockBase 0xF0000000 +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // ifndef _MUTEXRANK_H_ diff --git a/open-vm-tools/lib/include/mutexRankLib.h b/open-vm-tools/lib/include/mutexRankLib.h index 3726c1ffd..ee5f1ad1b 100644 --- a/open-vm-tools/lib/include/mutexRankLib.h +++ b/open-vm-tools/lib/include/mutexRankLib.h @@ -21,6 +21,10 @@ #include "mutexRank.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* * MXUser mutex ranks for bora/lib code. * @@ -197,5 +201,8 @@ #define RANK_licenseCheckLock (RANK_libLockBase + 0x7090) #define RANK_preferenceLock (RANK_libLockBase + 0x7100) +#if defined(__cplusplus) +} // extern "C" +#endif #endif /* _LIBMUTEXRANK_H */ diff --git a/open-vm-tools/modules/shared/vmmemctl/dbllnklst.h b/open-vm-tools/modules/shared/vmmemctl/dbllnklst.h index 2bec9eb43..df8e9ce13 100644 --- a/open-vm-tools/modules/shared/vmmemctl/dbllnklst.h +++ b/open-vm-tools/modules/shared/vmmemctl/dbllnklst.h @@ -70,6 +70,10 @@ #include "vm_basic_types.h" +#if defined(__cplusplus) +extern "C" { +#endif + #define DblLnkLst_OffsetOf(type, field) ((intptr_t)&((type *)0)->field) #define DblLnkLst_Container(addr, type, field) \ @@ -325,5 +329,8 @@ DblLnkLst_Swap(DblLnkLst_Links *head1, // IN/OUT } } +#if defined(__cplusplus) +} // extern "C" +#endif #endif /* _DBLLNKLST_H_ */ diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dnd.h b/open-vm-tools/services/plugins/dndcp/dnd/dnd.h index 38197a899..f9499572b 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dnd.h +++ b/open-vm-tools/services/plugins/dndcp/dnd/dnd.h @@ -27,17 +27,21 @@ #define _DND_H_ #define INCLUDE_ALLOW_USERLEVEL +#include "includeCheck.h" #ifdef _WIN32 # include # include #endif -#include "includeCheck.h" #include "vm_basic_types.h" #include "unicodeTypes.h" #include "dynarray.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* Error value returned when data contains illegal characters */ #define DND_ILLEGAL_CHARACTERS "data contains illegal characters" /* @@ -311,4 +315,8 @@ size_t DnD_TransportReqPacket(DnDTransportBuffer *buf, DnDTransportPacketHeader **packet); #endif // !SWIG +#if defined(__cplusplus) +} // extern "C" +#endif + #endif // _DND_H_ diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.h b/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.h index 365ab024f..e0dbf7023 100644 --- a/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.h +++ b/open-vm-tools/services/plugins/dndcp/dnd/dndMsg.h @@ -27,14 +27,18 @@ #define _DNDMSG_H_ #define INCLUDE_ALLOW_USERLEVEL - #include "includeCheck.h" + #include "vm_basic_types.h" #include "dynbuf.h" #include "dynarray.h" #include "dnd.h" +#if defined(__cplusplus) +extern "C" { +#endif + /* Various return types serialization/unserialization functions can return. */ typedef enum { @@ -157,4 +161,8 @@ Bool DnDMsg_Serialize(DnDMsg *msg, DynBuf *buf); DnDMsgErr DnDMsg_UnserializeHeader(DnDMsg *msg, void *buf, size_t len); DnDMsgErr DnDMsg_UnserializeArgs(DnDMsg *msg, void *buf, size_t len); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif /* _DNDMSG_H_ */