diff --git a/ngx_rtmp.h b/ngx_rtmp.h index cbe6a93e3..f59aa3239 100644 --- a/ngx_rtmp.h +++ b/ngx_rtmp.h @@ -18,7 +18,7 @@ #include "ngx_rtmp_bandwidth.h" -#if (NGX_WIN32) +#if (NGX_WIN32) && !defined(__int8) typedef __int8 int8_t; typedef unsigned __int8 uint8_t; #endif @@ -182,7 +182,7 @@ typedef struct { /* disable zero-sized array warning by msvc */ -#if (NGX_WIN32) +#if (NGX_WIN32) && (_MSC_VER) #pragma warning(push) #pragma warning(disable:4200) #endif @@ -271,7 +271,7 @@ typedef struct { } ngx_rtmp_session_t; -#if (NGX_WIN32) +#if (NGX_WIN32) && (_MSC_VER) #pragma warning(pop) #endif diff --git a/ngx_rtmp_auto_push_module.c b/ngx_rtmp_auto_push_module.c index 60c85d77b..ba84efa4e 100644 --- a/ngx_rtmp_auto_push_module.c +++ b/ngx_rtmp_auto_push_module.c @@ -10,9 +10,10 @@ #include "ngx_rtmp_relay_module.h" +#if !(NGX_WIN32) static ngx_rtmp_publish_pt next_publish; static ngx_rtmp_delete_stream_pt next_delete_stream; - +#endif static ngx_int_t ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle); static void ngx_rtmp_auto_push_exit_process(ngx_cycle_t *cycle); diff --git a/ngx_rtmp_eval.c b/ngx_rtmp_eval.c index 1e5195a90..c658f14ef 100644 --- a/ngx_rtmp_eval.c +++ b/ngx_rtmp_eval.c @@ -166,6 +166,7 @@ ngx_rtmp_eval(void *ctx, ngx_str_t *in, ngx_rtmp_eval_t **e, ngx_str_t *out, state = ESCAPE; continue; } + /* fall through */ case ESCAPE: ngx_rtmp_eval_append(&b, &c, 1, log); diff --git a/ngx_rtmp_exec_module.c b/ngx_rtmp_exec_module.c index fccd4ba70..541300523 100644 --- a/ngx_rtmp_exec_module.c +++ b/ngx_rtmp_exec_module.c @@ -284,6 +284,7 @@ ngx_module_t ngx_rtmp_exec_module = { }; +#if !(NGX_WIN32) static void ngx_rtmp_exec_eval_ctx_cstr(void *sctx, ngx_rtmp_eval_t *e, ngx_str_t *ret) { @@ -406,6 +407,7 @@ static ngx_rtmp_eval_t * ngx_rtmp_exec_event_eval[] = { ngx_rtmp_exec_event_specific_eval, NULL }; +#endif static void * diff --git a/ngx_rtmp_mp4_module.c b/ngx_rtmp_mp4_module.c index 0259ca2f6..f00204977 100644 --- a/ngx_rtmp_mp4_module.c +++ b/ngx_rtmp_mp4_module.c @@ -32,7 +32,7 @@ static ngx_int_t ngx_rtmp_mp4_reset(ngx_rtmp_session_t *s); /* disable zero-sized array warning by msvc */ -#if (NGX_WIN32) +#if (NGX_WIN32) && (_MSC_VER) #pragma warning(push) #pragma warning(disable:4200) #endif @@ -115,7 +115,7 @@ typedef struct { } ngx_rtmp_mp4_offsets64_t; -#if (NGX_WIN32) +#if (NGX_WIN32) && (_MSC_VER) #pragma warning(pop) #endif diff --git a/ngx_rtmp_record_module.c b/ngx_rtmp_record_module.c index dc2de12c4..4e2cebb99 100644 --- a/ngx_rtmp_record_module.c +++ b/ngx_rtmp_record_module.c @@ -510,12 +510,12 @@ ngx_rtmp_record_node_open(ngx_rtmp_session_t *s, #if (NGX_WIN32) { LONG lo, hi; - + DWORD ret; lo = 0; hi = 0; - lo = SetFilePointer(rctx->file.fd, lo, &hi, FILE_END); - file_size = (lo == INVALID_SET_FILE_POINTER ? - (off_t) -1 : (off_t) hi << 32 | (off_t) lo); + ret = SetFilePointer(rctx->file.fd, lo, &hi, FILE_END); + file_size = (ret == INVALID_SET_FILE_POINTER ? + (off_t) -1 : (off_t) hi << 32 | (off_t) ret); } #else file_size = lseek(rctx->file.fd, 0, SEEK_END);