mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-14 15:04:09 +00:00
porting sscrisk/CEL
This commit is contained in:
parent
ad60c8c530
commit
db20f64991
181 changed files with 2531 additions and 607 deletions
23
sprout/cstring/strchr.hpp
Normal file
23
sprout/cstring/strchr.hpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef SPROUT_CSTRING_STRCHR_HPP
|
||||
#define SPROUT_CSTRING_STRCHR_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
namespace sprout {
|
||||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 7.21.5.2 strchr ŠÖ<C5A0>”
|
||||
inline SPROUT_CONSTEXPR char const* strchr(char const* s, int c) {
|
||||
return *s == static_cast<char>(c) ? s
|
||||
: !*s ? nullptr
|
||||
: sprout::strchr(s + 1, c)
|
||||
;
|
||||
}
|
||||
|
||||
inline SPROUT_CONSTEXPR char* strchr(char* s, int c) {
|
||||
return const_cast<char*>(sprout::strchr(const_cast<char const*>(s), c));
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CSTRING_STRCHR_HPP
|
Loading…
Add table
Add a link
Reference in a new issue