From 05233a9bc6520190eb9550cb4a3cdf63d241ab71 Mon Sep 17 00:00:00 2001 From: Mistivia Date: Sat, 20 Dec 2025 17:23:54 +0800 Subject: add windows support --- Makefile | 5 +++++ s3_client.cpp | 2 ++ srtserver.c | 19 +++++++++++-------- transcode_talker.h | 1 - 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index c47dc4c..f812e50 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,15 @@ CC := gcc CXX := g++ CFLAGS := -g -Wall CXXFLAGS := -g -Wall -std=c++14 +UNAME := $(shell uname -s) LDFLAGS := -g -lsrt \ -lavformat -lavutil -lavcodec \ -laws-cpp-sdk-core -laws-cpp-sdk-s3 +ifeq ($(findstring MINGW,$(UNAME)),MINGW) + LDFLAGS += -lws2_32 +endif + C_SOURCES := $(shell find . -maxdepth 1 -name '*.c') CPP_SOURCES := $(shell find . -maxdepth 1 -name '*.cpp') diff --git a/s3_client.cpp b/s3_client.cpp index 8ef235b..28ab669 100644 --- a/s3_client.cpp +++ b/s3_client.cpp @@ -29,8 +29,10 @@ void S3Client_init() { Aws::Auth::AWSCredentials credentials; config.endpointOverride = ezlive_config->endpoint; config.region = ezlive_config->region; +#if !defined(_WIN32) config.checksumConfig.requestChecksumCalculation = Aws::Client::RequestChecksumCalculation::WHEN_REQUIRED; config.checksumConfig.responseChecksumValidation = Aws::Client::ResponseChecksumValidation::WHEN_REQUIRED; +#endif credentials = Aws::Auth::AWSCredentials(ezlive_config->access_key, ezlive_config->secret_key); s3client = new Aws::S3::S3Client(credentials, nullptr, config); } diff --git a/srtserver.c b/srtserver.c index 97ce272..65bc46d 100644 --- a/srtserver.c +++ b/srtserver.c @@ -6,14 +6,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#if defined(_WIN32) + #include +#else + #include + #include + #include + #include + #include + #include + #include +#endif #include diff --git a/transcode_talker.h b/transcode_talker.h index 4b0f301..9ec3817 100644 --- a/transcode_talker.h +++ b/transcode_talker.h @@ -3,7 +3,6 @@ #include "ringbuf.h" #include "pthread.h" -#include typedef struct { char *files[15]; -- cgit v1.0