Skip to content

Commit 7e65711

Browse files
authored
Merge pull request #1 from HerveAncher/mingw64-fix
Fix compilation under Windows/MinGW64
2 parents 23e1873 + 8f5ad8c commit 7e65711

6 files changed

+14
-10
lines changed

ngx_rtmp.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "ngx_rtmp_bandwidth.h"
1919

2020

21-
#if (NGX_WIN32)
21+
#if (NGX_WIN32) && !defined(__int8)
2222
typedef __int8 int8_t;
2323
typedef unsigned __int8 uint8_t;
2424
#endif
@@ -182,7 +182,7 @@ typedef struct {
182182

183183
/* disable zero-sized array warning by msvc */
184184

185-
#if (NGX_WIN32)
185+
#if (NGX_WIN32) && (_MSC_VER)
186186
#pragma warning(push)
187187
#pragma warning(disable:4200)
188188
#endif
@@ -271,7 +271,7 @@ typedef struct {
271271
} ngx_rtmp_session_t;
272272

273273

274-
#if (NGX_WIN32)
274+
#if (NGX_WIN32) && (_MSC_VER)
275275
#pragma warning(pop)
276276
#endif
277277

ngx_rtmp_auto_push_module.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
#include "ngx_rtmp_relay_module.h"
1111

1212

13+
#if !(NGX_WIN32)
1314
static ngx_rtmp_publish_pt next_publish;
1415
static ngx_rtmp_delete_stream_pt next_delete_stream;
15-
16+
#endif
1617

1718
static ngx_int_t ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle);
1819
static void ngx_rtmp_auto_push_exit_process(ngx_cycle_t *cycle);

ngx_rtmp_eval.c

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ ngx_rtmp_eval(void *ctx, ngx_str_t *in, ngx_rtmp_eval_t **e, ngx_str_t *out,
166166
state = ESCAPE;
167167
continue;
168168
}
169+
/* fall through */
169170

170171
/* fall through */
171172

ngx_rtmp_exec_module.c

+2
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ ngx_module_t ngx_rtmp_exec_module = {
284284
};
285285

286286

287+
#if !(NGX_WIN32)
287288
static void
288289
ngx_rtmp_exec_eval_ctx_cstr(void *sctx, ngx_rtmp_eval_t *e, ngx_str_t *ret)
289290
{
@@ -406,6 +407,7 @@ static ngx_rtmp_eval_t * ngx_rtmp_exec_event_eval[] = {
406407
ngx_rtmp_exec_event_specific_eval,
407408
NULL
408409
};
410+
#endif
409411

410412

411413
static void *

ngx_rtmp_mp4_module.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static ngx_int_t ngx_rtmp_mp4_reset(ngx_rtmp_session_t *s);
3232

3333
/* disable zero-sized array warning by msvc */
3434

35-
#if (NGX_WIN32)
35+
#if (NGX_WIN32) && (_MSC_VER)
3636
#pragma warning(push)
3737
#pragma warning(disable:4200)
3838
#endif
@@ -115,7 +115,7 @@ typedef struct {
115115
} ngx_rtmp_mp4_offsets64_t;
116116

117117

118-
#if (NGX_WIN32)
118+
#if (NGX_WIN32) && (_MSC_VER)
119119
#pragma warning(pop)
120120
#endif
121121

ngx_rtmp_record_module.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,12 @@ ngx_rtmp_record_node_open(ngx_rtmp_session_t *s,
510510
#if (NGX_WIN32)
511511
{
512512
LONG lo, hi;
513-
513+
DWORD ret;
514514
lo = 0;
515515
hi = 0;
516-
lo = SetFilePointer(rctx->file.fd, lo, &hi, FILE_END);
517-
file_size = (lo == INVALID_SET_FILE_POINTER ?
518-
(off_t) -1 : (off_t) hi << 32 | (off_t) lo);
516+
ret = SetFilePointer(rctx->file.fd, lo, &hi, FILE_END);
517+
file_size = (ret == INVALID_SET_FILE_POINTER ?
518+
(off_t) -1 : (off_t) hi << 32 | (off_t) ret);
519519
}
520520
#else
521521
file_size = lseek(rctx->file.fd, 0, SEEK_END);

0 commit comments

Comments
 (0)