summaryrefslogtreecommitdiff
path: root/src/include/common/string.h
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-10-10 14:42:16 -0700
committerAndres Freund <andres@anarazel.de>2017-10-10 14:50:30 -0700
commitfffd651e83ccbd6191a76be6ec7c6b1b27888fde (patch)
tree1c7f61fd5dfa8e540f2e27c1063ba9f8038370ba /src/include/common/string.h
parentfa5e119dc71ada8d023deadcb36dbfae328f8902 (diff)
Rewrite strnlen replacement implementation from 8a241792f96.
The previous placement of the fallback implementation in libpgcommon was problematic, because libpqport functions need strnlen functionality. Move replacement into libpgport. Provide strnlen() under its posix name, instead of pg_strnlen(). Fix stupid configure bug, executing the test only when compiled with threading support. Author: Andres Freund Discussion: https://postgr.es/m/E1e1gR2-0005fB-SI@gemulon.postgresql.org
Diffstat (limited to 'src/include/common/string.h')
-rw-r--r--src/include/common/string.h15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/include/common/string.h b/src/include/common/string.h
index 3d46b80918c..5f3ea71d613 100644
--- a/src/include/common/string.h
+++ b/src/include/common/string.h
@@ -12,19 +12,4 @@
extern bool pg_str_endswith(const char *str, const char *end);
-/*
- * Portable version of posix' strnlen.
- *
- * Returns the number of characters before a null-byte in the string pointed
- * to by str, unless there's no null-byte before maxlen. In the latter case
- * maxlen is returned.
- *
- * Use the system strnlen if provided, it's likely to be faster.
- */
-#ifdef HAVE_STRNLEN
-#define pg_strnlen(str, maxlen) strnlen(str, maxlen)
-#else
-extern size_t pg_strnlen(const char *str, size_t maxlen);
-#endif
-
#endif /* COMMON_STRING_H */