From 58d27c68a9d131e111ca488b42469bdae68e06e2 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Thu, 12 Sep 2019 22:01:11 +0200 Subject: Move stuff defined in PCH headers into a dedicated header The new header is not included in the PCH header(s) because it only defines a few macros and includes a single header. --- src/Utils.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/Utils.h (limited to 'src/Utils.h') diff --git a/src/Utils.h b/src/Utils.h new file mode 100644 index 000000000..a1a66e2f6 --- /dev/null +++ b/src/Utils.h @@ -0,0 +1,32 @@ +// Copyright 2005-2019 The Mumble Developers. All rights reserved. +// Use of this source code is governed by a BSD-style license +// that can be found in the LICENSE file at the root of the +// Mumble source tree or at . + +// This header file defines common utility macros and values that are generally valid or used across multiple areas giving them generic scope (rather than localized or functionality-specific scope). + +#ifndef MUMBLE_UTILS_H_ +#define MUMBLE_UTILS_H_ + +#include "QAtomicIntCompat.h" +#include "Qt4Compat.h" + +#include + +#define iroundf(x) ( static_cast(x) ) + +#ifdef Q_OS_WIN +# define STACKVAR(type, varname, count) type *varname=reinterpret_cast(_alloca(sizeof(type) * (count))) +#else +# ifdef WId + typedef WId HWND; +# endif +# define __cdecl +# define INVALID_SOCKET -1 +# define SOCKET_ERROR -1 +# define STACKVAR(type, varname, count) type varname[count] +# define CopyMemory(dst,ptr,len) memcpy(dst,ptr,len) +# define ZeroMemory(ptr,len) memset(ptr, 0, len) +#endif + +#endif // MUMBLE_UTILS_H_ -- cgit v1.2.3