#ifndef PARTITION_ALLOC_PARTITION_ALLOC_BASE_SCOPED_CLEAR_LAST_ERROR_H_
#define PARTITION_ALLOC_PARTITION_ALLOC_BASE_SCOPED_CLEAR_LAST_ERROR_H_
#include <cerrno>
#include "partition_alloc/build_config.h"
#include "partition_alloc/partition_alloc_base/component_export.h"
namespace partition_alloc::internal::base {
class PA_COMPONENT_EXPORT(PARTITION_ALLOC_BASE) ScopedClearLastErrorBase { … };
#if PA_BUILDFLAG(IS_WIN)
class PA_COMPONENT_EXPORT(PARTITION_ALLOC_BASE) ScopedClearLastError
: public ScopedClearLastErrorBase {
public:
ScopedClearLastError();
ScopedClearLastError(const ScopedClearLastError&) = delete;
ScopedClearLastError& operator=(const ScopedClearLastError&) = delete;
~ScopedClearLastError();
private:
const unsigned long last_system_error_;
};
#elif PA_BUILDFLAG(IS_POSIX) || PA_BUILDFLAG(IS_FUCHSIA)
ScopedClearLastError;
#endif
}
#endif