Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

Possible relevant lines from the source file:
```c
#if !defined(_WIN32)
#include <sys/time.h>
#endif
...
#if defined(_MSC_VER)
#include <time.h>
#include <sys/timeb.h>
#endif

static void js_random_init(JSContext *ctx)
{
#if defined(_MSC_VER) // FIXME: more precision
	struct _timeb	tb;
	_ftime(&tb);
	ctx->random_state = ( (int64_t)tb.time * 1000000) + (tb.millitm*1000);
#else
    struct timeval tv;
    gettimeofday(&tv, NULL);
    ctx->random_state = ((int64_t)tv.tv_sec * 1000000) + tv.tv_usec;
#endif
    /* the state must be non zero */
    if (ctx->random_state == 0)
        ctx->random_state = 1;

}
...
static JSValue js___date_clock(JSContext *ctx, JSValueConst this_val,
                               int argc, JSValueConst *argv)
{
	int64_t d;
#if defined(_MSC_VER) // FIXME: more precision
	struct _timeb	tb;
	_ftime(&tb);
	d = ( (int64_t)tb.time * 1000000) + (tb.millitm*1000);
#else
    struct timeval tv;
    gettimeofday(&tv, NULL);
	d = (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
#endif
    return JS_NewInt64(ctx, d);
}
```

excerpt from the make log:

```c
D:/mabs/build/gpac-git/src/quickjs/quickjs.c:10838:30: warning: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]
                else if (d > INT64_MAX)
                           ~ ^~~~~~~~~
D:/mabs/msys64/mingw32/include/stdint.h:84:19: note: expanded from macro 'INT64_MAX'
#define INT64_MAX 9223372036854775807LL
                  ^~~~~~~~~~~~~~~~~~~~~
D:/mabs/build/gpac-git/src/quickjs/quickjs.c:42033:5: error: call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    gettimeofday(&tv, NULL);
    ^
D:/mabs/build/gpac-git/src/quickjs/quickjs.c:42148:5: error: call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    gettimeofday(&tv, NULL);
    ^
D:/mabs/build/gpac-git/src/quickjs/quickjs.c:48381:5: error: call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    gettimeofday(&tv, NULL);
    ^
1 warning and 3 errors generated.
make[1]: *** [../config.mak:147: quickjs/quickjs.o] Error 1
make[1]: Leaving directory '/build/gpac-git/build-32bit/src'
make: *** [Makefile:13: all] Error 2
```

Possible suggested fixes:

1. Change `#if !defined(_WIN32)` to `#if !defined(_MSC_VER)` to match the rest of the file as mingw-w64 gcc does provide a `gettimeofday()` function
2. Change the `#if defined(_MSC_VER)`s in the rest of the file to `#if defined(_WIN32)` to include mingw-w64

mingw-w64 gcc: compilation failed on implicit gettimeofday
This is a GitHub Issue
repo:gpac
owner:gpac
Title : mingw-w64 gcc: compilation failed on implicit gettimeofday
Issue date:

--- start body ---
Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

Possible relevant lines from the source file:
```c
#if !defined(_WIN32)
#include <sys/time.h>
#endif
...
#if defined(_MSC_VER)
#include <time.h>
#include <sys/timeb.h>
#endif

static void js_random_init(JSContext *ctx)
{
#if defined(_MSC_VER) // FIXME: more precision
	struct _timeb	tb;
	_ftime(&tb);
	ctx->random_state = ( (int64_t)tb.time * 1000000) + (tb.millitm*1000);
#else
    struct timeval tv;
    gettimeofday(&tv, NULL);
    ctx->random_state = ((int64_t)tv.tv_sec * 1000000) + tv.tv_usec;
#endif
    /* the state must be non zero */
    if (ctx->random_state == 0)
        ctx->random_state = 1;

}
...
static JSValue js___date_clock(JSContext *ctx, JSValueConst this_val,
                               int argc, JSValueConst *argv)
{
	int64_t d;
#if defined(_MSC_VER) // FIXME: more precision
	struct _timeb	tb;
	_ftime(&tb);
	d = ( (int64_t)tb.time * 1000000) + (tb.millitm*1000);
#else
    struct timeval tv;
    gettimeofday(&tv, NULL);
	d = (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
#endif
    return JS_NewInt64(ctx, d);
}
```

excerpt from the make log:

```c
D:/mabs/build/gpac-git/src/quickjs/quickjs.c:10838:30: warning: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]
                else if (d > INT64_MAX)
                           ~ ^~~~~~~~~
D:/mabs/msys64/mingw32/include/stdint.h:84:19: note: expanded from macro 'INT64_MAX'
#define INT64_MAX 9223372036854775807LL
                  ^~~~~~~~~~~~~~~~~~~~~
D:/mabs/build/gpac-git/src/quickjs/quickjs.c:42033:5: error: call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    gettimeofday(&tv, NULL);
    ^
D:/mabs/build/gpac-git/src/quickjs/quickjs.c:42148:5: error: call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    gettimeofday(&tv, NULL);
    ^
D:/mabs/build/gpac-git/src/quickjs/quickjs.c:48381:5: error: call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    gettimeofday(&tv, NULL);
    ^
1 warning and 3 errors generated.
make[1]: *** [../config.mak:147: quickjs/quickjs.o] Error 1
make[1]: Leaving directory '/build/gpac-git/build-32bit/src'
make: *** [Makefile:13: all] Error 2
```

Possible suggested fixes:

1. Change `#if !defined(_WIN32)` to `#if !defined(_MSC_VER)` to match the rest of the file as mingw-w64 gcc does provide a `gettimeofday()` function
2. Change the `#if defined(_MSC_VER)`s in the rest of the file to `#if defined(_WIN32)` to include mingw-w64

--- end body ---
