Skip to content

Fix builds with GCC on Windows #15

@vhotspur

Description

@vhotspur

Using the default Windows configuration for GitHub Actions ends with the following bug:

compile-agent-gcc:
    [apply] D:\a\java-ubench-agent\java-ubench-agent\src\c\events.c: In function 'getter_thread_time':
    [apply] D:\a\java-ubench-agent\java-ubench-agent\src\c\events.c:96:60: warning: unused parameter 'bench' [-Wunused-parameter]
    [apply]    96 | static long long getter_thread_time(const benchmark_run_t *bench, const ubench_event_info_t *UNUSED_PARAMETER(info)) {
    [apply]       |                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
    [apply] In file included from D:\a\java-ubench-agent\java-ubench-agent\src\c\jnifunc.c:22:
    [apply] D:\a\java-ubench-agent\java-ubench-agent\src\c\jnifunc.c: In function 'Java_cz_cuni_mff_d3s_perf_NativeThreads_getNativeId':
    [apply] D:\a\java-ubench-agent\java-ubench-agent\out\agent/cz_cuni_mff_d3s_perf_NativeThreads.h:11:63: error: invalid suffix "i64" on integer constant
    [apply]    11 | #define cz_cuni_mff_d3s_perf_NativeThreads_INVALID_THREAD_ID -1i64
    [apply]       |                                                               ^~~~
    [apply] D:\a\java-ubench-agent\java-ubench-agent\src\c\jnifunc.c:39:32: note: in expansion of macro 'cz_cuni_mff_d3s_perf_NativeThreads_INVALID_THREAD_ID'
    [apply]    39 |                 return (jlong) cz_cuni_mff_d3s_perf_NativeThreads_INVALID_THREAD_ID;
    [apply]       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Probably caused by javah generating MSVC-specific header as i64 suffix is a non-standard MS extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions