Add CMake check if the getline function is defined

instead of listing the systems and versions that need to be defined.

This resolves FTBFS on FreeBSD 12.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 5 years ago
parent bd87db0c6d
commit 0542509fc1
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -31,6 +31,7 @@ endif( )
check_include_file( "sys/stropts.h" HAVE_SYS_STROPTS_H )
check_function_exists( "mkfifo" HAVE_MKFIFO )
check_symbol_exists( "getline" "stdio.h" HAVE_GETLINE )
##### check for berkeley db ####################

@ -8,3 +8,6 @@
// lib/catalog
#cmakedefine USE_DB_H_PATH <@USE_DB_H_PATH@>
// vcs/clearcase
#cmakedefine HAVE_GETLINE 1

@ -13,6 +13,7 @@ add_subdirectory( integrator )
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/lib/interfaces
${CMAKE_SOURCE_DIR}/lib/interfaces/extensions
${CMAKE_SOURCE_DIR}/lib/util

@ -9,6 +9,7 @@
// Copyright: See COPYING file that comes with this distribution
//
//
#include "config.h"
#include "clearcasemanipulator.h"
#include <kprocess.h>
@ -23,9 +24,8 @@
#include <sys/param.h>
#endif
#if defined(Q_OS_MACX) || defined(MACOSX) || defined(Q_OS_SOLARIS) || defined(Q_OS_FREEBSD) || (defined(__NetBSD__) && (__NetBSD_Version__ < 599001500)) || defined(__DragonFly__)
#if !defined( HAVE_GETLINE )
//this function is taken from GNU libc
//it does not exist on macos
int getline(char **lineptr, size_t *n, FILE *stream)
{
static char line[256];

Loading…
Cancel
Save