Add extern "C" to header files.
#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) \
}
}
+#if defined(__cplusplus)
+} // extern "C"
+#endif
#endif /* _DBLLNKLST_H_ */
#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
Bool
DictLL_ReadUTF8BOM(FILE *file); // IN/OUT
+#if defined(__cplusplus)
+} // extern "C"
+#endif
#endif /* __DICTLL_H__ */
#include "vm_basic_types.h"
#include "vm_assert.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
typedef struct DynArray {
DynBuf buf;
/* Define DynArray of DynBuf. */
DEFINE_DYNARRAY_TYPE(DynBuf)
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif /* _DYNARRAY_H_ */
#include "vm_basic_types.h"
#include "vm_assert.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
typedef struct DynBuf {
char *data;
return DynBuf_Append(buf, string, strlen(string) + 1);
}
+#if defined(__cplusplus)
+} // extern "C"
+#endif
#endif /* __DYNBUF_H__ */
#include <rpc/xdr.h>
#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_ */
#ifndef _ERR_H_
#define _ERR_H_
-#if !defined(_WIN32)
-#include <errno.h>
-#endif
-
#define INCLUDE_ALLOW_USERLEVEL
#define INCLUDE_ALLOW_VMCORE
#include "includeCheck.h"
-
#if defined(__cplusplus)
extern "C" {
#endif
+#if !defined(_WIN32)
+#include <errno.h>
+#endif
+
#if defined(_WIN32)
typedef DWORD Err_Number;
#else
Err_SetErrno(e); \
} while (FALSE)
-#ifdef __cplusplus
-}
+#if defined(__cplusplus)
+} // extern "C"
#endif
#endif
#include "vmware.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
void *
Escape_DoString(const char *escStr, // IN
int const *bytesToEsc, // IN
char *
Escape_Comma(const char *string); // IN
+#if defined(__cplusplus)
+} // extern "C"
+#endif
#endif /* __ESCAPE_H__ */
#ifndef _FILE_H_
#define _FILE_H_
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-#include <stdio.h>
#define INCLUDE_ALLOW_USERLEVEL
#define INCLUDE_ALLOW_VMCORE
#include "includeCheck.h"
+#include <stdio.h>
+
#include "fileIO.h"
#include "unicodeTypes.h"
#include "err.h"
#define FILE_MAXPATH PATH_MAX
#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
#define FILE_SEARCHPATHTOKEN ";"
Bool File_DoesVolumeSupportAcls(const char *pathName);
-#ifdef __cplusplus
-} // extern "C" {
+#if defined(__cplusplus)
+} // extern "C"
#endif
#endif // ifndef _FILE_H_
#ifndef _FILEIO_H_
#define _FILEIO_H_
-#ifdef __cplusplus
-extern "C"{
-#endif
-
#define INCLUDE_ALLOW_USERLEVEL
#define INCLUDE_ALLOW_VMCORE
#include "includeCheck.h"
#include "iovector.h" // for struct iovec
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
struct FileLockToken;
#if defined(_WIN32)
Bool FileIO_SupportsPrealloc(const char *pathName,
Bool fsCheck);
-#ifdef __cplusplus
-} // extern "C" {
+#if defined(__cplusplus)
+} // extern "C"
#endif
#endif // _FILEIO_H_
#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
int FileLock_LockDevice(const char *device);
Bool FileLock_UnlockDevice(const char *device);
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // ifndef _FILELOCK_H_
#ifndef _GLIBUTILS_H_
#define _GLIBUTILS_H_
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/**
* @file glibUtils.h
*
#endif
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif /* _GLIBUTILS_H_ */
#include "aioMgr.h"
#endif
-typedef struct HashMap HashMap;
-
-#ifdef __cplusplus
+#if defined(__cplusplus)
extern "C" {
#endif
+typedef struct HashMap HashMap;
/*
* ----------------------------------------------------------------------------
void *userData);
Bool HashMap_DoTests(void);
-#ifdef __cplusplus
-}
+#if defined(__cplusplus)
+} // extern "C"
#endif
#endif /* _HASHMAP_H_ */
#include "vm_basic_defs.h"
#include "vm_atomic.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
typedef struct HashTable HashTable;
typedef struct PtrHashTable PtrHashTable;
Bool PtrHash_Delete(PtrHashTable *hashTable,
const void *keyPtr);
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif
#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 */
void HgfsServer_Quiesce(Bool freeze);
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // _HGFS_SERVER_H_
#ifndef _HGFS_SERVER_MANAGER_H_
# define _HGFS_SERVER_MANAGER_H_
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* hgfsServerManager.h --
*
uint32 HgfsServerManager_InvalidateInactiveSessions(HgfsServerMgrData *mgrData);
#endif
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // _HGFS_SERVER_MANAGER_H_
#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.
HgfsServerPolicy_ShareList *
HgfsServerPolicy_GetSharesWithTag(const char *tag); // IN: tag to search for
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // _HGFS_SERVER_POLICY_H_
#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_ */
#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)
char *Hostinfo_GetHardwareModel(void);
#endif
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif /* ifndef _HOSTINFO_H_ */
#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_
/*********************************************************
- * 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
#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
#define INCLUDE_ALLOW_VMCORE
#include "includeCheck.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* Ugly definition of struct iovec.
*/
#define IOV_ASSERT(IOVEC, NUM_ENTRIES) ((void) 0)
#endif
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif /* #ifndef _IOVECTOR_H_ */
#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
#define INCLUDE_ALLOW_USERLEVEL
#define INCLUDE_ALLOW_VMCORE
-
#include "includeCheck.h"
-#include "productState.h"
+#include "productState.h"
#include <stdarg.h>
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* The bora/lib Log Facility log level model.
int limit);
#endif /* !VMM */
+
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif /* VMWARE_LOG_H */
#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%.
uint32 *numerator,
uint32 *denominator);
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // _LOGFIXED_H_
#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
#endif
}
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif
#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_ */
#include "voblib.h"
#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
#define INVALID_MSG_CODE (-1)
const char *Msg_HResult2String(long hr);
#endif
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // ifndef _MSG_H_
#include "msgid.h"
#include "msgfmt.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* Data structures, types, and constants
Bool MsgList_Present(const MsgList *messages);
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // ifndef _MSGLIST_H_
#include "str.h" // for HAS_BSD_PRINTF
#endif
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* Format parser callback functions
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_
#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 <string.h>
#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) \
return idString;
}
+#if defined(__cplusplus)
+} // extern "C"
+#endif
#endif // ifndef _MSGID_H_
#define INCLUDE_ALLOW_USERLEVEL
#define INCLUDE_ALLOW_VMCORE
-
#include "includeCheck.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* Core rank defines.
*
*/
#define RANK_libLockBase 0xF0000000
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // ifndef _MUTEXRANK_H_
#include "mutexRank.h"
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/*
* MXUser mutex ranks for bora/lib code.
*
#define RANK_licenseCheckLock (RANK_libLockBase + 0x7090)
#define RANK_preferenceLock (RANK_libLockBase + 0x7100)
+#if defined(__cplusplus)
+} // extern "C"
+#endif
#endif /* _LIBMUTEXRANK_H */
#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) \
}
}
+#if defined(__cplusplus)
+} // extern "C"
+#endif
#endif /* _DBLLNKLST_H_ */
#define _DND_H_
#define INCLUDE_ALLOW_USERLEVEL
+#include "includeCheck.h"
#ifdef _WIN32
# include <windows.h>
# include <shellapi.h>
#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"
/*
DnDTransportPacketHeader **packet);
#endif // !SWIG
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // _DND_H_
#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 {
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_ */