Skip to content
Snippets Groups Projects
Commit 6fc29808 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #3696: Added HAVE_STRNLEN, because strnlen() is GNU only

parent 03fb289d
No related branches found
No related tags found
No related merge requests found
......@@ -126,6 +126,18 @@ if(NOT DEFINED LOFAR_GENERAL_INCLUDED)
}" HAVE_GETPROTOBYNAME_R)
endif(HAVE_NETDB_H)
## --------------------------------------------------------------------------
## Define `STRNLEN', if the strnlen() function exists.
## --------------------------------------------------------------------------
check_c_source_compiles("
#include <string.h>
#include <stdio.h>
int main() {
char *s = \"test\";
int i = 3;
unsigned l = strnlen(s,i);
}" HAVE_STRNLEN)
## --------------------------------------------------------------------------
## Define custom target 'check', so that we can do 'make check', like we did
## with the GNU Autotools. Tests should be added with lofar_add_test().
......
......@@ -172,3 +172,6 @@
/* Define to 1 if you have a declaration for the `getprotobyname_r' function. */
#cmakedefine HAVE_GETPROTOBYNAME_R 1
/* Define to 1 if you have a declaration for the `strnlen' function. */
#cmakedefine HAVE_STRNLEN 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment