From 02fc10918ceee4bb6e0b7c70a3b5a234a6284b47 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 17 Jun 2018 18:57:11 -0700 Subject: [PATCH] include: declare uv_cpu_times_s in higher scope This fixes a C/C++ ambiguity about whether this structure is scoped or global. PR-URL: https://github.com/libuv/libuv/pull/1888 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- include/uv.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/uv.h b/include/uv.h index 0d999402..192f3d9b 100644 --- a/include/uv.h +++ b/include/uv.h @@ -1004,16 +1004,18 @@ UV_EXTERN int uv_queue_work(uv_loop_t* loop, UV_EXTERN int uv_cancel(uv_req_t* req); +struct uv_cpu_times_s { + uint64_t user; + uint64_t nice; + uint64_t sys; + uint64_t idle; + uint64_t irq; +}; + struct uv_cpu_info_s { char* model; int speed; - struct uv_cpu_times_s { - uint64_t user; - uint64_t nice; - uint64_t sys; - uint64_t idle; - uint64_t irq; - } cpu_times; + struct uv_cpu_times_s cpu_times; }; struct uv_interface_address_s {