mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
Fixes for DragonFly BSD from Weitian LI #1121
This commit is contained in:
parent
01d9b63c5b
commit
d4aef247ea
@ -262,6 +262,8 @@ target_compile_definitions(notcurses-static
|
||||
set(PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set(PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig")
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "DragonFly")
|
||||
set(PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig")
|
||||
endif()
|
||||
|
||||
# libnotcurses++
|
||||
@ -375,7 +377,7 @@ install(FILES ${NCPP_INTERNAL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/n
|
||||
|
||||
# notcurses-demo
|
||||
file(GLOB DEMOSRCS CONFIGURE_DEPENDS src/demo/*.c)
|
||||
add_executable(notcurses-demo ${DEMOSRCS})
|
||||
add_executable(notcurses-demo ${DEMOSRCS} ${COMPATSRC})
|
||||
target_compile_definitions(notcurses-demo
|
||||
PRIVATE
|
||||
_GNU_SOURCE
|
||||
@ -549,7 +551,7 @@ target_link_libraries(notcurses-tetris
|
||||
# notcurses-view
|
||||
if(${USE_FFMPEG} OR ${USE_OIIO})
|
||||
file(GLOB VIEWSRCS CONFIGURE_DEPENDS src/view/*.cpp)
|
||||
add_executable(notcurses-view ${VIEWSRCS})
|
||||
add_executable(notcurses-view ${VIEWSRCS} ${COMPATSRC})
|
||||
target_include_directories(notcurses-view
|
||||
PRIVATE
|
||||
include
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef __linux__
|
||||
#ifndef __FreeBSD__
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
#include "compat/compat.h"
|
||||
// clock_nanosleep is unavailable on DragonFly BSD and Mac OS X
|
||||
int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *request,
|
||||
struct timespec *remain){
|
||||
@ -9,7 +11,7 @@ int clock_nanosleep(clockid_t clockid, int flags, const struct timespec *request
|
||||
return -1;
|
||||
}
|
||||
uint64_t nowns = timespec_to_ns(&now);
|
||||
uint64_t targns = timespec_to_ns(&request);
|
||||
uint64_t targns = timespec_to_ns(request);
|
||||
if(flags != TIMER_ABSTIME){
|
||||
targns += nowns;
|
||||
}
|
||||
|
@ -1,6 +1,10 @@
|
||||
#ifndef NOTCURSES_COMPAT
|
||||
#define NOTCURSES_COMPAT
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#define NANOSECS_IN_SEC 1000000000ul
|
||||
@ -24,4 +28,8 @@ int clock_nanosleep(clockid_t clockid, int flags,
|
||||
const struct timespec *request,
|
||||
struct timespec *remain);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user