Skip to content

Commit

Permalink
Merge branch 'dev-fix-multicast-windows' of github.com:ethouris/srt i…
Browse files Browse the repository at this point in the history
…nto dev-fix-multicast-windows
  • Loading branch information
Mikolaj Malecki committed Sep 28, 2017
2 parents d04eb32 + 0acc534 commit c3d0344
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,10 @@ if ( ENABLE_CXX11 )
${CMAKE_SOURCE_DIR}/common/transmitmedia.cpp
${CMAKE_SOURCE_DIR}/common/srt_compat.c
)
# Enforce interpreting this file as C++ so that C++ compiler is used to compile it.
# This should result in exactly the same as when it was compiled as C, with the
# exception that the compiler with accept any C++-only COMPILE_FLAGS (e.g. -std=c++11).
set_source_files_properties(${CMAKE_SOURCE_DIR}/common/srt_compat.c PROPERTIES LANGUAGE CXX )

add_executable(srt-live-transmit
${CMAKE_SOURCE_DIR}/apps/srt-live-transmit.cpp
Expand Down
16 changes: 16 additions & 0 deletions common/srt_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ written by
#include <mach/mach_time.h>
#include <AvailabilityMacros.h>

#ifdef __cplusplus
extern "C" {
#endif


int OSX_clock_gettime(clockid_t clock_id, struct timespec * ts)
{
Expand Down Expand Up @@ -137,8 +141,15 @@ int OSX_clock_gettime(clockid_t clock_id, struct timespec * ts)
return result;
}

#ifdef __cplusplus
} // extern C
#endif

#endif // (__MACH__)

#ifdef __cplusplus
extern "C" {
#endif

extern const char * SysStrError(int errnum, char * buf, size_t buflen)
{
Expand Down Expand Up @@ -202,3 +213,8 @@ extern const char * SysStrError(int errnum, char * buf, size_t buflen)
}
#endif
}


#ifdef __cplusplus
} // extern C
#endif
5 changes: 2 additions & 3 deletions common/srt_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ written by
#define HAISRT_COMPAT_H__

#include <stddef.h>
#include <time.h>

#ifdef __cplusplus
extern "C" {
Expand All @@ -36,7 +37,6 @@ extern "C" {
#if defined(__MACH__)

#include <AvailabilityMacros.h>
#include <time.h>
#include <errno.h>
#include <pthread.h>
#include <string.h>
Expand Down Expand Up @@ -187,7 +187,6 @@ inline struct tm LocalTime(time_t tt)
}



#endif
#endif // defined C++

#endif // HAISRT_COMPAT_H__

0 comments on commit c3d0344

Please sign in to comment.