Skip to content

Commit 02883cb

Browse files
authored
Merge pull request #1675 from mharbison72/issue-1660
process_collector: avoid a compiler warning on macOS (fixes #1660)
2 parents 0c73c1c + 3c21cc0 commit 02883cb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

prometheus/process_collector_cgo_darwin.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515

1616
#include <mach/mach_init.h>
1717
#include <mach/task.h>
18-
// Compiler warns that shared_memory_server.h is deprecated, use this instead.
19-
// But this doesn't define SHARED_DATA_REGION_SIZE or SHARED_TEXT_REGION_SIZE.
20-
//#include <mach/shared_region.h>
21-
#include <mach/shared_memory_server.h>
2218
#include <mach/mach_vm.h>
2319

20+
// The compiler warns that mach/shared_memory_server.h is deprecated, and to use
21+
// mach/shared_region.h instead. But that doesn't define
22+
// SHARED_DATA_REGION_SIZE or SHARED_TEXT_REGION_SIZE, so redefine them here and
23+
// avoid a warning message when running tests.
24+
#define GLOBAL_SHARED_TEXT_SEGMENT 0x90000000U
25+
#define SHARED_DATA_REGION_SIZE 0x10000000
26+
#define SHARED_TEXT_REGION_SIZE 0x10000000
27+
2428

2529
int get_memory_info(unsigned long long *rss, unsigned long long *vsize)
2630
{

0 commit comments

Comments
 (0)