llvm/openmp/runtime/src/thirdparty/ittnotify/legacy/ittnotify.h


//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _LEGACY_ITTNOTIFY_H_
#define _LEGACY_ITTNOTIFY_H_

/**
 * @file
 * @brief Legacy User API functions and types
 */

/** @cond exclude_from_documentation */
#ifndef ITT_OS_WIN
#define ITT_OS_WIN
#endif /* ITT_OS_WIN */

#ifndef ITT_OS_LINUX
#define ITT_OS_LINUX
#endif /* ITT_OS_LINUX */

#ifndef ITT_OS_MAC
#define ITT_OS_MAC
#endif /* ITT_OS_MAC */

#ifndef ITT_OS_FREEBSD
#define ITT_OS_FREEBSD
#endif /* ITT_OS_FREEBSD */

#ifndef ITT_OS
#if defined WIN32 || defined _WIN32
#define ITT_OS
#elif defined(__APPLE__) && defined(__MACH__)
#define ITT_OS
#elif defined(__FreeBSD__)
#define ITT_OS
#else
#define ITT_OS
#endif
#endif /* ITT_OS */

#ifndef ITT_PLATFORM_WIN
#define ITT_PLATFORM_WIN
#endif /* ITT_PLATFORM_WIN */

#ifndef ITT_PLATFORM_POSIX
#define ITT_PLATFORM_POSIX
#endif /* ITT_PLATFORM_POSIX */

#ifndef ITT_PLATFORM_MAC
#define ITT_PLATFORM_MAC
#endif /* ITT_PLATFORM_MAC */

#ifndef ITT_PLATFORM_FREEBSD
#define ITT_PLATFORM_FREEBSD
#endif /* ITT_PLATFORM_FREEBSD */

#ifndef ITT_PLATFORM
#if ITT_OS == ITT_OS_WIN
#define ITT_PLATFORM
#elif ITT_OS == ITT_OS_MAC
#define ITT_PLATFORM
#elif ITT_OS == ITT_OS_FREEBSD
#define ITT_PLATFORM
#else
#define ITT_PLATFORM
#endif
#endif /* ITT_PLATFORM */

#if defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif

#include <stddef.h>
#if ITT_PLATFORM == ITT_PLATFORM_WIN
#include <tchar.h>
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#include <stdint.h>
#if defined(UNICODE) || defined(_UNICODE)
#include <wchar.h>
#endif /* UNICODE || _UNICODE */
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */

#ifndef ITTAPI_CDECL
#if ITT_PLATFORM == ITT_PLATFORM_WIN
#define ITTAPI_CDECL
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if defined _M_IX86 || defined __i386__
#define ITTAPI_CDECL
#else /* _M_IX86 || __i386__ */
#define ITTAPI_CDECL
#endif /* _M_IX86 || __i386__ */
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* ITTAPI_CDECL */

#ifndef STDCALL
#if ITT_PLATFORM == ITT_PLATFORM_WIN
#define STDCALL
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if defined _M_IX86 || defined __i386__
#define STDCALL
#else /* _M_IX86 || __i386__ */
#define STDCALL
#endif /* _M_IX86 || __i386__ */
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* STDCALL */

#define ITTAPI
#define LIBITTAPI

/* TODO: Temporary for compatibility! */
#define ITTAPI_CALL
#define LIBITTAPI_CALL

#if ITT_PLATFORM == ITT_PLATFORM_WIN
/* use __forceinline (VC++ specific) */
#if defined(__MINGW32__) && !defined(__cplusplus)
#define ITT_INLINE
#else
#define ITT_INLINE
#endif /* __MINGW32__ */

#define ITT_INLINE_ATTRIBUTE
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/*
 * Generally, functions are not inlined unless optimization is specified.
 * For functions declared inline, this attribute inlines the function even
 * if no optimization level was specified.
 */
#ifdef __STRICT_ANSI__
#define ITT_INLINE
#define ITT_INLINE_ATTRIBUTE
#else /* __STRICT_ANSI__ */
#define ITT_INLINE
#define ITT_INLINE_ATTRIBUTE
#endif /* __STRICT_ANSI__ */
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/** @endcond */

/** @cond exclude_from_documentation */
/* Helper macro for joining tokens */
#define ITT_JOIN_AUX(p, n)
#define ITT_JOIN(p, n)

#ifdef ITT_MAJOR
#undef ITT_MAJOR
#endif
#ifdef ITT_MINOR
#undef ITT_MINOR
#endif
#define ITT_MAJOR
#define ITT_MINOR

/* Standard versioning of a token with major and minor version numbers */
#define ITT_VERSIONIZE(x)

#ifndef INTEL_ITTNOTIFY_PREFIX
#define INTEL_ITTNOTIFY_PREFIX
#endif /* INTEL_ITTNOTIFY_PREFIX */
#ifndef INTEL_ITTNOTIFY_POSTFIX
#define INTEL_ITTNOTIFY_POSTFIX
#endif /* INTEL_ITTNOTIFY_POSTFIX */

#define ITTNOTIFY_NAME_AUX(n)
#define ITTNOTIFY_NAME(n)

#define ITTNOTIFY_VOID(n)
#define ITTNOTIFY_DATA(n)

#define ITTNOTIFY_VOID_D0(n, d)
#define ITTNOTIFY_VOID_D1(n, d, x)
#define ITTNOTIFY_VOID_D2(n, d, x, y)
#define ITTNOTIFY_VOID_D3(n, d, x, y, z)
#define ITTNOTIFY_VOID_D4(n, d, x, y, z, a)
#define ITTNOTIFY_VOID_D5(n, d, x, y, z, a, b)
#define ITTNOTIFY_VOID_D6(n, d, x, y, z, a, b, c)
#define ITTNOTIFY_DATA_D0(n, d)
#define ITTNOTIFY_DATA_D1(n, d, x)
#define ITTNOTIFY_DATA_D2(n, d, x, y)
#define ITTNOTIFY_DATA_D3(n, d, x, y, z)
#define ITTNOTIFY_DATA_D4(n, d, x, y, z, a)
#define ITTNOTIFY_DATA_D5(n, d, x, y, z, a, b)
#define ITTNOTIFY_DATA_D6(n, d, x, y, z, a, b, c)

#ifdef ITT_STUB
#undef ITT_STUB
#endif
#ifdef ITT_STUBV
#undef ITT_STUBV
#endif
#define ITT_STUBV(api, type, name, args)
#define ITT_STUB
/** @endcond */

#ifdef __cplusplus
extern
#endif /* __cplusplus */

#endif /* _LEGACY_ITTNOTIFY_H_ */