diff --git a/BACKLOG.md b/BACKLOG.md index dde1df8..fe45946 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -16,7 +16,3 @@ * Eliminate bs_test(). * Make it easy to run a single case, or a single set. * Use bs_test_case_init(), bs_test_case_fini() for the overloaded prepare/report. - -## c2x_compat - -* Eliminate this. C function overwrites cause build failures :-/ diff --git a/include/libbase/c2x_compat.h b/include/libbase/c2x_compat.h deleted file mode 100644 index 4261cfc..0000000 --- a/include/libbase/c2x_compat.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ========================================================================= */ -/** - * @file c2x_compat.h - * Compatibility layer for upcoming convenient C2x methods. - * - * @copyright - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __LIBBASE_C2X_COMPAT_H__ -#define __LIBBASE_C2X_COMPAT_H__ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -/** - * Returns a pointer to a new string which is a duplicate of `s`. - * - * @param s - * - * @return A pointer to the duplicated string, to be free'd with free(3). - */ -char *strdup(const char*s); - -#ifdef __cplusplus -} // extern "C" -#endif // __cplusplus - -#endif /* __LIBBASE_C2X_COMPAT_H__ */ -/* == End of c2x_compat.h ================================================== */ diff --git a/include/libbase/libbase.h b/include/libbase/libbase.h index 2b15962..3c6bf70 100644 --- a/include/libbase/libbase.h +++ b/include/libbase/libbase.h @@ -25,7 +25,6 @@ #include "assert.h" #include "atomic.h" #include "avltree.h" -#include "c2x_compat.h" #include "def.h" #include "dequeue.h" #include "dllist.h" @@ -52,7 +51,6 @@ // IWYU pragma: no_include "libbase/assert.h" // IWYU pragma: no_include "libbase/atomic.h" // IWYU pragma: no_include "libbase/avltree.h" -// IWYU pragma: no_include "libbase/c2x_compat.h" // IWYU pragma: no_include "libbase/def.h" // IWYU pragma: no_include "libbase/dequeue.h" // IWYU pragma: no_include "libbase/dllist.h" diff --git a/include/libbase/log_wrappers.h b/include/libbase/log_wrappers.h index 2f2951b..3c9589b 100644 --- a/include/libbase/log_wrappers.h +++ b/include/libbase/log_wrappers.h @@ -24,7 +24,6 @@ #include "log.h" #include -#include "c2x_compat.h" #ifdef __cplusplus extern "C" { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a63b39b..217b490 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,7 +17,6 @@ SET(PUBLIC_HEADER_FILES assert.h atomic.h avltree.h - c2x_compat.h def.h dequeue.h dllist.h @@ -43,7 +42,6 @@ SET(SOURCES arg.c atomic.c avltree.c - c2x_compat.c dequeue.c dllist.c dynbuf.c diff --git a/src/c2x_compat.c b/src/c2x_compat.c deleted file mode 100644 index e7344b9..0000000 --- a/src/c2x_compat.c +++ /dev/null @@ -1,36 +0,0 @@ -/* ========================================================================= */ -/** - * @file c2x_compat.c - * - * @copyright - * Copyright 2023 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include -#include - -/* ------------------------------------------------------------------------- */ -char *strdup(const char *str) { - size_t len = strlen(str); - char *new_ptr = malloc(len + 1); - if (NULL == new_ptr) return NULL; - new_ptr[len] = '\0'; - memcpy(new_ptr, str, len); - return new_ptr; -} - -/* == End of c2x_compat.c ================================================== */