1//
2// FPEnvironment.cpp
3//
4// Library: Foundation
5// Package: Core
6// Module: FPEnvironment
7//
8// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
9// and Contributors.
10//
11// SPDX-License-Identifier: BSL-1.0
12//
13
14
15// pull in platform identification macros needed below
16#include "Poco/Platform.h"
17#include "Poco/FPEnvironment.h"
18
19
20#if defined(POCO_NO_FPENVIRONMENT)
21#include "FPEnvironment_DUMMY.cpp"
22#elif defined(__osf__) || defined(__VMS)
23#include "FPEnvironment_DEC.cpp"
24#elif defined(sun) || defined(__sun)
25#include "FPEnvironment_SUN.cpp"
26#elif defined(__QNX__)
27#include "FPEnvironment_QNX.cpp"
28#elif defined(POCO_OS_FAMILY_UNIX)
29#include "FPEnvironment_C99.cpp"
30#elif defined(POCO_OS_FAMILY_WINDOWS)
31#include "FPEnvironment_WIN32.cpp"
32#else
33#include "FPEnvironment_DUMMY.cpp"
34#endif
35
36
37namespace Poco {
38
39
40FPEnvironment::FPEnvironment()
41{
42}
43
44
45FPEnvironment::FPEnvironment(RoundingMode rm)
46{
47 setRoundingMode(rm);
48}
49
50
51FPEnvironment::FPEnvironment(const FPEnvironment& env): FPEnvironmentImpl(env)
52{
53}
54
55
56FPEnvironment::~FPEnvironment()
57{
58}
59
60
61FPEnvironment& FPEnvironment::operator = (const FPEnvironment& env)
62{
63 if (&env != this)
64 {
65 FPEnvironmentImpl::operator = (env);
66 }
67 return *this;
68}
69
70
71void FPEnvironment::keepCurrent()
72{
73 keepCurrentImpl();
74}
75
76
77void FPEnvironment::clearFlags()
78{
79 clearFlagsImpl();
80}
81
82
83} // namespace Poco
84