Skip to content

Commit 5e87196

Browse files
committed
[CMakeLists.txt] Expose as non-header-only lib ; [c89stringutils/{CMakeLists.txt,c89stringutils_string_]extras{.h,.c}}] clang-format
1 parent 0c57e43 commit 5e87196

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ if (BUILD_TESTING)
4141
add_subdirectory("c89stringutils_tests")
4242
endif (BUILD_TESTING)
4343

44-
# header-only so including this will pollute the `find_path` suggestion in vcpkg
45-
#install(
46-
# FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h"
47-
# DESTINATION "include"
48-
#)
44+
install(
45+
FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h"
46+
DESTINATION "include"
47+
)
4948

5049
include(InstallRequiredSystemLibraries)
5150
set(CPACK_BUNDLE_NAME "${PROJECT_NAME}")
@@ -82,3 +81,7 @@ write_basic_package_version_file(
8281
VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}"
8382
COMPATIBILITY AnyNewerVersion
8483
)
84+
install(FILES
85+
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
86+
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
87+
DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}")

c89stringutils/c89stringutils_string_extras.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* */
55

66
#include <stdlib.h>
7+
78
#include "c89stringutils_string_extras.h"
89

910
#if !defined(HAVE_SNPRINTF_H)

c89stringutils/c89stringutils_string_extras.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ typedef int errno_t;
107107
* SPDX-License-Identifier: BSD-2-Clause
108108
*/
109109

110-
C89STRINGUTILS_EXPORT inline int snprintf(char *buffer, size_t count, const char *format, ...);
110+
C89STRINGUTILS_EXPORT inline int snprintf(char *buffer, size_t count,
111+
const char *format, ...);
111112

112-
C89STRINGUTILS_EXPORT inline double wtf_vsnprintf(char *buffer, size_t count, const char *format,
113-
va_list args);
113+
C89STRINGUTILS_EXPORT inline double
114+
wtf_vsnprintf(char *buffer, size_t count, const char *format, va_list args);
114115

115116
/* Work around a difference in Microsoft's implementation of vsnprintf, where
116117
vsnprintf does not null terminate the buffer. WebKit can rely on the null
@@ -123,7 +124,8 @@ C89STRINGUTILS_EXPORT inline double wtf_vsnprintf(char *buffer, size_t count, co
123124

124125
#ifndef HAVE_STRNCASECMP_H
125126

126-
extern C89STRINGUTILS_EXPORT int strncasecmp(const char *, const char *, size_t);
127+
extern C89STRINGUTILS_EXPORT int strncasecmp(const char *, const char *,
128+
size_t);
127129

128130
extern C89STRINGUTILS_EXPORT int strcasecmp(const char *, const char *);
129131

@@ -157,7 +159,8 @@ extern C89STRINGUTILS_EXPORT size_t strerrorlen_s(errno_t);
157159

158160
#ifndef HAVE_ASPRINTF
159161

160-
extern C89STRINGUTILS_EXPORT int vasprintf(char **str, const char *fmt, va_list ap);
162+
extern C89STRINGUTILS_EXPORT int vasprintf(char **str, const char *fmt,
163+
va_list ap);
161164

162165
extern C89STRINGUTILS_EXPORT int asprintf(char **str, const char *fmt, ...);
163166

0 commit comments

Comments
 (0)