Skip to content

Commit

Permalink
[core] Move SRT_API definition to srt.h
Browse files Browse the repository at this point in the history
Add srt.h include where needed
  • Loading branch information
yomnes0 committed Mar 5, 2024
1 parent 314606f commit eec3cda
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions srtcore/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ modified by
*****************************************************************************/

#include "platform_sys.h"
#include <srt.h>
#include <iostream>
#include <iomanip> // Logging
#include <srt_compat.h>
Expand Down
13 changes: 0 additions & 13 deletions srtcore/platform_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
//
// SRT_IMPORT_TIME (mach time on Mac, portability gettimeofday on WIN32)
// SRT_IMPORT_EVENT (includes kevent on Mac)
#ifndef SRT_API
#ifdef _WIN32
#ifndef __MINGW32__
// Explicitly define 32-bit and 64-bit numbers
Expand All @@ -35,18 +34,6 @@
typedef __int64 uint64_t;
#endif
#endif
#ifdef SRT_DYNAMIC
#ifdef SRT_EXPORTS
#define SRT_API __declspec(dllexport)
#else
#define SRT_API __declspec(dllimport)
#endif
#else // !SRT_DYNAMIC
#define SRT_API
#endif
#else
#define SRT_API __attribute__ ((visibility("default")))
#endif
#endif


Expand Down
15 changes: 15 additions & 0 deletions srtcore/srt.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ written by
#ifndef INC_SRTC_H
#define INC_SRTC_H

#ifndef SRT_API

#ifdef SRT_DYNAMIC
#ifdef SRT_EXPORTS
#define SRT_API __declspec(dllexport)
#else
#define SRT_API __declspec(dllimport)
#endif
#else // !SRT_DYNAMIC
#define SRT_API
#endif
#else
#define SRT_API __attribute__ ((visibility("default")))
#endif

#include "version.h"

#include "platform_sys.h"
Expand Down
1 change: 1 addition & 0 deletions srtcore/srt_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ written by
// Prevents from misconfiguration through preprocessor.

#include "platform_sys.h"
#include <srt.h>
#include <srt_compat.h>

#include <string.h>
Expand Down

0 comments on commit eec3cda

Please sign in to comment.