build: Prepend UVGRTP_ to exported preprocessor definitions.

This commit is contained in:
Mansour Moufid 2022-07-18 22:04:32 -04:00
parent 6dcd709773
commit 3020622875
3 changed files with 9 additions and 9 deletions

View File

@ -159,16 +159,16 @@ if (UNIX)
check_cxx_symbol_exists(sendmmsg sys/socket.h HAVE_SENDMMSG)
if(HAVE_GETRANDOM)
list(APPEND UVGRTP_CXX_FLAGS "-DHAVE_GETRANDOM=1")
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_GETRANDOM=1)
list(APPEND UVGRTP_CXX_FLAGS "-DUVGRTP_HAVE_GETRANDOM=1")
target_compile_definitions(${PROJECT_NAME} PRIVATE UVGRTP_HAVE_GETRANDOM=1)
endif()
if(HAVE_SENDMSG)
list(APPEND UVGRTP_CXX_FLAGS "-DHAVE_SENDMSG=1")
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_SENDMSG=1)
list(APPEND UVGRTP_CXX_FLAGS "-DUVGRTP_HAVE_SENDMSG=1")
target_compile_definitions(${PROJECT_NAME} PRIVATE UVGRTP_HAVE_SENDMSG=1)
endif()
if(HAVE_SENDMMSG)
list(APPEND UVGRTP_CXX_FLAGS "-DHAVE_SENDMMSG=1")
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_SENDMMSG=1)
list(APPEND UVGRTP_CXX_FLAGS "-DUVGRTP_HAVE_SENDMMSG=1")
target_compile_definitions(${PROJECT_NAME} PRIVATE UVGRTP_HAVE_SENDMMSG=1)
endif()
# Try finding if pkg-config installed in the system

View File

@ -22,7 +22,7 @@ namespace uvgrtp {
typedef unsigned int socklen_t;
#endif
#if defined(HAVE_SENDMSG) && !defined(HAVE_SENDMMSG)
#if defined(UVGRTP_HAVE_SENDMSG) && !defined(UVGRTP_HAVE_SENDMMSG)
struct mmsghdr {
struct msghdr msg_hdr;
unsigned int msg_len;

View File

@ -2,7 +2,7 @@
#include "uvgrtp/debug.hh"
#if defined(HAVE_GETRANDOM)
#if defined(UVGRTP_HAVE_GETRANDOM)
#include <sys/random.h>
#elif defined(_WIN32)
#include <winsock2.h>
@ -33,7 +33,7 @@ rtp_error_t uvgrtp::random::init()
int uvgrtp::random::generate(void *buf, size_t n)
{
#if defined(HAVE_GETRANDOM)
#if defined(UVGRTP_HAVE_GETRANDOM)
return getrandom(buf, n, 0);