Skip to content

Fix compilation under Windows/MinGW64 #1564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ngx_rtmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -271,7 +271,7 @@ typedef struct {
} ngx_rtmp_session_t;


#if (NGX_WIN32)
#if (NGX_WIN32) && (_MSC_VER)
#pragma warning(pop)
#endif

Expand Down
3 changes: 2 additions & 1 deletion ngx_rtmp_auto_push_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions ngx_rtmp_eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions ngx_rtmp_exec_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -406,6 +407,7 @@ static ngx_rtmp_eval_t * ngx_rtmp_exec_event_eval[] = {
ngx_rtmp_exec_event_specific_eval,
NULL
};
#endif


static void *
Expand Down
4 changes: 2 additions & 2 deletions ngx_rtmp_mp4_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -115,7 +115,7 @@ typedef struct {
} ngx_rtmp_mp4_offsets64_t;


#if (NGX_WIN32)
#if (NGX_WIN32) && (_MSC_VER)
#pragma warning(pop)
#endif

Expand Down
8 changes: 4 additions & 4 deletions ngx_rtmp_record_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down