Skip to content

Commit 4bf0c6b

Browse files
sribee8Sriya Pratipati
andauthored
[libc][bazel] Added wchar functions to bazel (#146126)
Added wchar functions, apart from ones that use mbstate_t. to the bazel files --------- Co-authored-by: Sriya Pratipati <[email protected]>
1 parent 163a7e1 commit 4bf0c6b

File tree

2 files changed

+526
-0
lines changed

2 files changed

+526
-0
lines changed

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 312 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,19 @@ libc_support_library(
268268
hdrs = ["hdr/unistd_overlay.h"],
269269
)
270270

271+
libc_support_library(
272+
name = "hdr_wchar_macros",
273+
hdrs = ["hdr/wchar_macros.h"],
274+
deps = [
275+
":hdr_wchar_overlay",
276+
],
277+
)
278+
279+
libc_support_library(
280+
name = "hdr_wchar_overlay",
281+
hdrs = ["hdr/wchar_overlay.h"],
282+
)
283+
271284
############################ Type Proxy Header Files ###########################
272285

273286
libc_support_library(
@@ -432,6 +445,22 @@ libc_support_library(
432445
hdrs = ["hdr/types/struct_msghdr.h"],
433446
)
434447

448+
libc_support_library(
449+
name = "types_wchar_t",
450+
hdrs = ["hdr/types/wchar_t.h"],
451+
deps = [
452+
":hdr_wchar_overlay",
453+
],
454+
)
455+
456+
libc_support_library(
457+
name = "types_wint_t",
458+
hdrs = ["hdr/types/wint_t.h"],
459+
deps = [
460+
":hdr_wchar_overlay",
461+
],
462+
)
463+
435464
############################### Support libraries ##############################
436465

437466
libc_support_library(
@@ -1645,6 +1674,16 @@ libc_support_library(
16451674
],
16461675
)
16471676

1677+
libc_support_library(
1678+
name = "__support_wctype_utils",
1679+
hdrs = ["src/__support/wctype_utils.h"],
1680+
deps = [
1681+
":__support_cpp_optional",
1682+
":__support_macros_attributes",
1683+
":__support_macros_config",
1684+
],
1685+
)
1686+
16481687
########################## externally shared targets ###########################
16491688

16501689
libc_header_library(
@@ -5685,3 +5724,276 @@ libc_function(
56855724
":types_struct_timespec",
56865725
],
56875726
)
5727+
5728+
############################## wchar targets ###############################
5729+
5730+
libc_function(
5731+
name = "btowc",
5732+
srcs = ["src/wchar/btowc.cpp"],
5733+
hdrs = ["src/wchar/btowc.h"],
5734+
deps = [
5735+
":__support_common",
5736+
":__support_macros_config",
5737+
":__support_wctype_utils",
5738+
":hdr_wchar_macros",
5739+
":types_wint_t",
5740+
],
5741+
)
5742+
5743+
libc_function(
5744+
name = "wcpcpy",
5745+
srcs = ["src/wchar/wcpcpy.cpp"],
5746+
hdrs = ["src/wchar/wcpcpy.h"],
5747+
deps = [
5748+
":__support_common",
5749+
":__support_macros_config",
5750+
":string_utils",
5751+
":types_size_t",
5752+
":types_wchar_t",
5753+
],
5754+
)
5755+
5756+
libc_function(
5757+
name = "wcpncpy",
5758+
srcs = ["src/wchar/wcpncpy.cpp"],
5759+
hdrs = ["src/wchar/wcpncpy.h"],
5760+
deps = [
5761+
":__support_common",
5762+
":__support_macros_config",
5763+
":__support_macros_null_check",
5764+
":types_size_t",
5765+
":types_wchar_t",
5766+
],
5767+
)
5768+
5769+
libc_function(
5770+
name = "wcscat",
5771+
srcs = ["src/wchar/wcscat.cpp"],
5772+
hdrs = ["src/wchar/wcscat.h"],
5773+
deps = [
5774+
":__support_common",
5775+
":__support_macros_config",
5776+
":string_utils",
5777+
":types_size_t",
5778+
":types_wchar_t",
5779+
],
5780+
)
5781+
5782+
libc_function(
5783+
name = "wcschr",
5784+
srcs = ["src/wchar/wcschr.cpp"],
5785+
hdrs = ["src/wchar/wcschr.h"],
5786+
deps = [
5787+
":__support_common",
5788+
":__support_macros_config",
5789+
":types_wchar_t",
5790+
],
5791+
)
5792+
5793+
libc_function(
5794+
name = "wcscmp",
5795+
srcs = ["src/wchar/wcscmp.cpp"],
5796+
hdrs = ["src/wchar/wcscmp.h"],
5797+
deps = [
5798+
":__support_common",
5799+
":__support_macros_null_check",
5800+
":types_size_t",
5801+
":types_wchar_t",
5802+
],
5803+
)
5804+
5805+
libc_function(
5806+
name = "wcscpy",
5807+
srcs = ["src/wchar/wcscpy.cpp"],
5808+
hdrs = ["src/wchar/wcscpy.h"],
5809+
deps = [
5810+
":__support_common",
5811+
":__support_macros_config",
5812+
":string_utils",
5813+
":types_size_t",
5814+
":types_wchar_t",
5815+
],
5816+
)
5817+
5818+
libc_function(
5819+
name = "wcslen",
5820+
srcs = ["src/wchar/wcslen.cpp"],
5821+
hdrs = ["src/wchar/wcslen.h"],
5822+
deps = [
5823+
":__support_common",
5824+
":__support_macros_config",
5825+
":string_utils",
5826+
":types_size_t",
5827+
":types_wchar_t",
5828+
],
5829+
)
5830+
5831+
libc_function(
5832+
name = "wcsncat",
5833+
srcs = ["src/wchar/wcsncat.cpp"],
5834+
hdrs = ["src/wchar/wcsncat.h"],
5835+
deps = [
5836+
":__support_common",
5837+
":__support_macros_config",
5838+
":string_utils",
5839+
":types_size_t",
5840+
":types_wchar_t",
5841+
],
5842+
)
5843+
5844+
libc_function(
5845+
name = "wcsncmp",
5846+
srcs = ["src/wchar/wcsncmp.cpp"],
5847+
hdrs = ["src/wchar/wcsncmp.h"],
5848+
deps = [
5849+
":__support_common",
5850+
":__support_macros_null_check",
5851+
":types_size_t",
5852+
":types_wchar_t",
5853+
],
5854+
)
5855+
5856+
libc_function(
5857+
name = "wcsncpy",
5858+
srcs = ["src/wchar/wcsncpy.cpp"],
5859+
hdrs = ["src/wchar/wcsncpy.h"],
5860+
deps = [
5861+
":__support_common",
5862+
":__support_macros_config",
5863+
":types_size_t",
5864+
":types_wchar_t",
5865+
],
5866+
)
5867+
5868+
libc_function(
5869+
name = "wcspbrk",
5870+
srcs = ["src/wchar/wcspbrk.cpp"],
5871+
hdrs = ["src/wchar/wcspbrk.h"],
5872+
deps = [
5873+
":__support_common",
5874+
":__support_macros_null_check",
5875+
":types_wchar_t",
5876+
],
5877+
)
5878+
5879+
libc_function(
5880+
name = "wcsrchr",
5881+
srcs = ["src/wchar/wcsrchr.cpp"],
5882+
hdrs = ["src/wchar/wcsrchr.h"],
5883+
deps = [
5884+
":__support_common",
5885+
":__support_macros_config",
5886+
":__support_macros_null_check",
5887+
":types_wchar_t",
5888+
],
5889+
)
5890+
5891+
libc_function(
5892+
name = "wcsspn",
5893+
srcs = ["src/wchar/wcsspn.cpp"],
5894+
hdrs = ["src/wchar/wcsspn.h"],
5895+
deps = [
5896+
":__support_common",
5897+
":__support_macros_config",
5898+
":types_size_t",
5899+
":types_wchar_t",
5900+
],
5901+
)
5902+
5903+
libc_function(
5904+
name = "wcsstr",
5905+
srcs = ["src/wchar/wcsstr.cpp"],
5906+
hdrs = ["src/wchar/wcsstr.h"],
5907+
deps = [
5908+
":__support_common",
5909+
":__support_macros_config",
5910+
":string_utils",
5911+
":types_size_t",
5912+
":types_wchar_t",
5913+
],
5914+
)
5915+
5916+
libc_function(
5917+
name = "wctob",
5918+
srcs = ["src/wchar/wctob.cpp"],
5919+
hdrs = ["src/wchar/wctob.h"],
5920+
deps = [
5921+
":__support_common",
5922+
":__support_macros_config",
5923+
":__support_macros_null_check",
5924+
":__support_wctype_utils",
5925+
":hdr_stdio_macros",
5926+
":types_wint_t",
5927+
],
5928+
)
5929+
5930+
libc_function(
5931+
name = "wmemchr",
5932+
srcs = ["src/wchar/wmemchr.cpp"],
5933+
hdrs = ["src/wchar/wmemchr.h"],
5934+
deps = [
5935+
":__support_common",
5936+
":__support_macros_config",
5937+
":types_size_t",
5938+
":types_wchar_t",
5939+
],
5940+
)
5941+
5942+
libc_function(
5943+
name = "wmemcmp",
5944+
srcs = ["src/wchar/wmemcmp.cpp"],
5945+
hdrs = ["src/wchar/wmemcmp.h"],
5946+
deps = [
5947+
":__support_common",
5948+
":__support_macros_config",
5949+
":__support_macros_null_check",
5950+
":types_size_t",
5951+
":types_wchar_t",
5952+
],
5953+
)
5954+
5955+
libc_function(
5956+
name = "wmemcpy",
5957+
srcs = ["src/wchar/wmemcpy.cpp"],
5958+
hdrs = ["src/wchar/wmemcpy.h"],
5959+
deps = [
5960+
":__support_common",
5961+
":__support_macros_config",
5962+
":types_size_t",
5963+
":types_wchar_t",
5964+
],
5965+
)
5966+
5967+
libc_function(
5968+
name = "wmemmove",
5969+
srcs = ["src/wchar/wmemmove.cpp"],
5970+
hdrs = ["src/wchar/wmemmove.h"],
5971+
deps = [
5972+
":__support_common",
5973+
":__support_macros_null_check",
5974+
":types_size_t",
5975+
":types_wchar_t",
5976+
],
5977+
)
5978+
5979+
libc_function(
5980+
name = "wmempcpy",
5981+
srcs = ["src/wchar/wmempcpy.cpp"],
5982+
hdrs = ["src/wchar/wmempcpy.h"],
5983+
deps = [
5984+
":__support_common",
5985+
":types_size_t",
5986+
":types_wchar_t",
5987+
],
5988+
)
5989+
5990+
libc_function(
5991+
name = "wmemset",
5992+
srcs = ["src/wchar/wmemset.cpp"],
5993+
hdrs = ["src/wchar/wmemset.h"],
5994+
deps = [
5995+
":__support_common",
5996+
":types_size_t",
5997+
":types_wchar_t",
5998+
],
5999+
)

0 commit comments

Comments
 (0)