Skip to content

Commit 7c9ad02

Browse files
committed
license and include guards
1 parent 6245ef1 commit 7c9ad02

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

libc/src/__support/wchar/character_converter.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1+
//===-- Definition of a class for mbstate_t and conversion -----*-- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_CHARACTER_CONVERTER_H
10+
#define LLVM_LIBC_SRC___SUPPORT_CHARACTER_CONVERTER_H
111

212
#include "hdr/types/wchar_t.h"
313
#include "src/__support/wchar/mbstate.h"
414
#include "src/__support/wchar/utf_ret.h"
515

16+
namespace LIBC_NAMESPACE_DECL {
17+
618
class CharacterConverter {
719
private:
820
mbstate_t *state;
@@ -18,3 +30,7 @@ class CharacterConverter {
1830
utf_ret<char> pop_utf8();
1931
utf_ret<wchar_t> pop_utf32();
2032
};
33+
34+
} // namespace LIBC_NAMESPACE_DECL
35+
36+
#endif // LLVM_LIBC_SRC___SUPPORT_CHARACTER_CONVERTER_H

libc/src/__support/wchar/mbstate.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1+
//===-- Definition of mbstate_t -------------------------- -----*-- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_MBSTATE_H
10+
#define LLVM_LIBC_SRC___SUPPORT_MBSTATE_H
111

212
#include "hdr/types/wchar_t.h"
313

14+
namespace LIBC_NAMESPACE_DECL {
15+
416
struct mbstate_t {
517
wchar_t partial;
618
unsigned char bits_processed;
719
unsigned char total_bytes;
8-
};
20+
};
21+
22+
} // namespace LIBC_NAMESPACE_DECL
23+
24+
#endif // LLVM_LIBC_SRC___SUPPORT_MBSTATE_H
25+

libc/src/__support/wchar/utf_ret.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1+
//===-- Definition of utf_ret ----------------------------------*-- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_UTF_RET_H
10+
#define LLVM_LIBC_SRC___SUPPORT_UTF_RET_H
11+
12+
namespace LIBC_NAMESPACE_DECL {
113

214
template <typename T> struct utf_ret {
315
T out;
416
int error;
517
};
18+
19+
} // namespace LIBC_NAMESPACE_DECL
20+
21+
#endif // LLVM_LIBC_SRC___SUPPORT_UTF_RET_H

0 commit comments

Comments
 (0)