1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 01:57:09 +00:00

Merge pull request #120 from ncopa/master

Compatibility improvements
This commit is contained in:
Brenden Matthews 2015-07-30 16:00:51 -07:00
commit 7044c5296d
5 changed files with 21 additions and 11 deletions

View File

@ -71,10 +71,10 @@ set(VERSION_MAJOR "1")
set(VERSION_MINOR "10")
set(VERSION_PATCH "1")
find_program(APP_GAWK gawk)
if(NOT APP_GAWK)
message(FATAL_ERROR "Unable to find program 'gawk'")
endif(NOT APP_GAWK)
find_program(APP_AWK awk)
if(NOT APP_AWK)
message(FATAL_ERROR "Unable to find program 'awk'")
endif(NOT APP_AWK)
find_program(APP_WC wc)
if(NOT APP_WC)
@ -99,7 +99,7 @@ if(NOT RELEASE)
mark_as_advanced(APP_GIT)
endif(NOT RELEASE)
mark_as_advanced(APP_GAWK APP_WC APP_DATE APP_UNAME)
mark_as_advanced(APP_AWK APP_WC APP_DATE APP_UNAME)
#BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
#BUILD_ARCH="$(uname -sr) ($(uname -m))"

View File

@ -44,7 +44,7 @@ endif(CPACK_GENERATOR MATCHES "NSIS")
# Source package setup. Compile with "make package_source".
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION}-src")
set(CPACK_SOURCE_GENERATOR "TBZ2")
execute_process(COMMAND ${APP_UNAME} COMMAND ${APP_GAWK} "{print $1}"
execute_process(COMMAND ${APP_UNAME} COMMAND ${APP_AWK} "{print $1}"
RESULT_VARIABLE RETVAL OUTPUT_VARIABLE CPU_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)

View File

@ -105,7 +105,7 @@ endif(BUILD_IRC)
if(BUILD_IPV6)
find_file(IF_INET6 if_inet6 PATHS /proc/net)
if(NOT IF_INET6)
message(FATAL_ERROR "/proc/net/if_inet6 unavailable")
message(WARNING "/proc/net/if_inet6 unavailable")
endif(NOT IF_INET6)
endif(BUILD_IPV6)
@ -422,6 +422,6 @@ if(DEBUG)
execute_process(COMMAND
${APP_GIT} --git-dir=${CMAKE_CURRENT_SOURCE_DIR}/.git log
--since=${VERSION_MAJOR}-${VERSION_MINOR}-01 --pretty=oneline COMMAND
${APP_WC} -l COMMAND ${APP_GAWK} "{print $1}" RESULT_VARIABLE RETVAL
${APP_WC} -l COMMAND ${APP_AWK} "{print $1}" RESULT_VARIABLE RETVAL
OUTPUT_VARIABLE COMMIT_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE)
endif(DEBUG)

View File

@ -26,8 +26,17 @@
#include "c++wrap.hh"
#include <unistd.h>
/* force use of POSIX strerror_r instead of non-portable GNU specific */
#ifdef _GNU_SOURCE
#undef _GNU_SOURCE
#endif
#include <string.h>
#if __cplusplus <= 199711L
#define thread_local __thread
#endif
#if !defined(HAVE_PIPE2) || !defined(HAVE_O_CLOEXEC)
#include <fcntl.h>
@ -62,8 +71,10 @@ namespace {
std::string strerror_r(int errnum)
{
char buf[100];
return strerror_r(errnum, buf, sizeof buf);
static thread_local char buf[100];
if (strerror_r(errnum, buf, sizeof buf) != 0)
snprintf(buf, sizeof buf, "Unknown error %i", errnum);
return buf;
}
std::pair<int, int> pipe2(int flags)

View File

@ -42,7 +42,6 @@
#include <errno.h>
#include <time.h>
#include <sys/ioctl.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <pthread.h>