FPEnvironment.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // FPEnvironment.cpp
  3. //
  4. // $Id: //poco/1.4/Foundation/src/FPEnvironment.cpp#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Core
  8. // Module: FPEnvironment
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. // pull in platform identification macros needed below
  16. #include "Poco/Platform.h"
  17. #if defined(POCO_NO_FPENVIRONMENT)
  18. #include "FPEnvironment_DUMMY.cpp"
  19. #elif defined(__osf__) || defined(__VMS)
  20. #include "FPEnvironment_DEC.cpp"
  21. #elif defined(sun) || defined(__sun)
  22. #include "FPEnvironment_SUN.cpp"
  23. #elif defined(POCO_OS_FAMILY_UNIX)
  24. #include "FPEnvironment_C99.cpp"
  25. #elif defined(POCO_OS_FAMILY_WINDOWS)
  26. #include "FPEnvironment_WIN32.cpp"
  27. #else
  28. #include "FPEnvironment_DUMMY.cpp"
  29. #endif
  30. // header file must be included after platform-specific part
  31. // due to _XOPEN_SOURCE conflict on Tru64 (see FPEnvironment_DEC.cpp)
  32. #include "Poco/FPEnvironment.h"
  33. namespace Poco {
  34. FPEnvironment::FPEnvironment()
  35. {
  36. }
  37. FPEnvironment::FPEnvironment(RoundingMode rm)
  38. {
  39. setRoundingMode(rm);
  40. }
  41. FPEnvironment::FPEnvironment(const FPEnvironment& env): FPEnvironmentImpl(env)
  42. {
  43. }
  44. FPEnvironment::~FPEnvironment()
  45. {
  46. }
  47. FPEnvironment& FPEnvironment::operator = (const FPEnvironment& env)
  48. {
  49. if (&env != this)
  50. {
  51. FPEnvironmentImpl::operator = (env);
  52. }
  53. return *this;
  54. }
  55. void FPEnvironment::keepCurrent()
  56. {
  57. keepCurrentImpl();
  58. }
  59. void FPEnvironment::clearFlags()
  60. {
  61. clearFlagsImpl();
  62. }
  63. } // namespace Poco