dcerpc-nt: add UNION_ALIGN_TO... helpers
[wireshark-sm.git] / wsutil / type_util.h
blobcc8199f5997f8afe85d3f23a56ed0a8468db0464
1 /** @file
2 * Types utility definitions
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
11 #ifndef __TYPE_UTIL_H__
12 #define __TYPE_UTIL_H__
14 #include <inttypes.h>
15 #include "ws_symbol_export.h"
18 * uint64_t to double conversions taken from gstutils.h of GStreamer project
20 * GStreamer
21 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
22 * 2000 Wim Taymans <wtay@chello.be>
23 * 2002 Thomas Vander Stichele <thomas@apestaart.org>
25 * gstutils.h: Header for various utility functions
27 * GNU GPL v2
31 WS_DLL_PUBLIC
32 uint64_t type_util_double_to_uint64(double value);
33 WS_DLL_PUBLIC
34 double type_util_uint64_to_double(uint64_t value);
36 #ifdef _WIN32
37 #define double_to_uint64(value) type_util_double_to_uint64(value)
38 #define uint64_to_double(value) type_util_uint64_to_double(value)
39 #else
40 #define double_to_uint64(value) ((uint64_t)(value))
41 #define uint64_to_double(value) ((double)(value))
42 #endif
44 #endif /* __TYPE_UTIL_H__ */