porting sscrisk/CEL

This commit is contained in:
bolero-MURAKAMI 2012-04-01 22:15:09 +09:00
parent ad60c8c530
commit db20f64991
181 changed files with 2531 additions and 607 deletions

31
sprout/cstdlib/abs.hpp Normal file
View file

@ -0,0 +1,31 @@
#ifndef SPROUT_CSTDLIB_ABS_HPP
#define SPROUT_CSTDLIB_ABS_HPP
#include <sprout/config.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 7.20.6.1 abs<62>Clabs<62>CyÑ llabs ŠÖ<C5A0>
SPROUT_CONSTEXPR int abs(int j) {
return j < 0 ? -j : j;
}
SPROUT_CONSTEXPR long labs(long j) {
return j < 0 ? -j : j;
}
SPROUT_CONSTEXPR long long llabs(long long j) {
return j < 0 ? -j : j;
}
SPROUT_CONSTEXPR long abs(long j) {
return labs(j);
}
SPROUT_CONSTEXPR long long abs(long long j) {
return llabs(j);
}
} // namespace sprout
#endif // #ifndef SPROUT_CSTDLIB_ABS_HPP