diff --git a/headers/private/libroot/ErrnoMaintainer.h b/headers/private/libroot/ErrnoMaintainer.h new file mode 100644 index 0000000000..c01f3d912e --- /dev/null +++ b/headers/private/libroot/ErrnoMaintainer.h @@ -0,0 +1,39 @@ +/* + * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de. + * Distributed under the terms of the MIT License. + */ +#ifndef _ERRNO_MAINTAINER_H +#define _ERRNO_MAINTAINER_H + + +#include + + +namespace BPrivate { + + +/** + * A helper class resetting errno to 0 if it has been set during the execution + * of ICU methods. Any changes of errno shall only be done by our callers. + */ +class ErrnoMaintainer { +public: + ErrnoMaintainer() + : fErrnoUponEntry(errno) + { + } + + ~ErrnoMaintainer() + { + if (errno != 0 && fErrnoUponEntry == 0) + errno = 0; + } +private: + int fErrnoUponEntry; +}; + + +} // namespace BPrivate + + +#endif // _ERRNO_MAINTAINER_H diff --git a/src/system/libroot/add-ons/icu/locale/ICULocaleBackend.cpp b/src/system/libroot/add-ons/icu/locale/ICULocaleBackend.cpp index 5da7902019..844a5aa5cb 100644 --- a/src/system/libroot/add-ons/icu/locale/ICULocaleBackend.cpp +++ b/src/system/libroot/add-ons/icu/locale/ICULocaleBackend.cpp @@ -8,11 +8,12 @@ #include -#include #include #include #include +#include + namespace BPrivate { @@ -24,27 +25,6 @@ CreateInstance() } -/** - * A helper class resetting errno to 0 if it has been set during the execution - * of ICU methods. Any changes of errno shall only be done by our callers. - */ -class ErrnoMaintainer { -public: - ErrnoMaintainer() - : fErrnoUponEntry(errno) - { - } - - ~ErrnoMaintainer() - { - if (errno != 0 && fErrnoUponEntry == 0) - errno = 0; - } -private: - int fErrnoUponEntry; -}; - - ICULocaleBackend::ICULocaleBackend() : fMonetaryData(fLocaleConv), diff --git a/src/system/libroot/add-ons/icu/locale/Jamfile b/src/system/libroot/add-ons/icu/locale/Jamfile index 21e68dbd53..470e093440 100644 --- a/src/system/libroot/add-ons/icu/locale/Jamfile +++ b/src/system/libroot/add-ons/icu/locale/Jamfile @@ -1,7 +1,10 @@ SubDir HAIKU_TOP src system libroot add-ons icu locale ; -UsePrivateHeaders [ FDirName libroot locale ] ; -UsePrivateHeaders [ FDirName libroot time ] ; +UsePrivateHeaders + libroot + [ FDirName libroot locale ] + [ FDirName libroot time ] +; local sources = ICUCategoryData.cpp