build: fix build on macOS

This commit is contained in:
Christian Hergert
2019-06-04 14:35:48 -07:00
parent af2a17daa5
commit 807bff9152
9 changed files with 15 additions and 11 deletions

View File

@ -52,6 +52,7 @@ static void
sysprof_cpu_aid_prepare (SysprofAid *self,
SysprofProfiler *profiler)
{
#ifdef __linux__
g_autoptr(SysprofSource) source = NULL;
g_assert (SYSPROF_IS_CPU_AID (self));
@ -59,6 +60,7 @@ sysprof_cpu_aid_prepare (SysprofAid *self,
source = sysprof_hostinfo_source_new ();
sysprof_profiler_add_source (profiler, source);
#endif
}
static void

View File

@ -52,6 +52,7 @@ static void
sysprof_memory_aid_prepare (SysprofAid *self,
SysprofProfiler *profiler)
{
#ifdef __linux__
g_autoptr(SysprofSource) source = NULL;
g_assert (SYSPROF_IS_MEMORY_AID (self));
@ -59,6 +60,7 @@ sysprof_memory_aid_prepare (SysprofAid *self,
source = sysprof_memory_source_new ();
sysprof_profiler_add_source (profiler, source);
#endif
}
static void

View File

@ -53,7 +53,6 @@ sysprof_recording_state_view_notify_elapsed (SysprofRecordingStateView *self,
SysprofProfiler *profiler)
{
SysprofRecordingStateViewPrivate *priv = sysprof_recording_state_view_get_instance_private (self);
g_autofree gchar *str = NULL;
SysprofCaptureWriter *writer;
gint64 elapsed;

View File

@ -272,6 +272,7 @@ get_lines (const char *format,
...)
G_GNUC_PRINTF (1, 2);
#ifdef __linux__
static char **
get_lines (const char *format,
...)
@ -296,6 +297,7 @@ get_lines (const char *format,
return result;
}
#endif
static const uint8_t *
get_vdso_bytes (size_t *length)

View File

@ -92,7 +92,7 @@ endif
if host_machine.system() == 'darwin'
libsysprof_deps += [ dependency('libelf') ]
libsysprof_c_args = [ '-DNT_GNU_BUILD_ID=3', '-DELF_NOTE_GNU="GNU"', '-D__LIBELF_INTERNAL__' ]
libsysprof_c_args += [ '-DNT_GNU_BUILD_ID=3', '-DELF_NOTE_GNU="GNU"', '-D__LIBELF_INTERNAL__' ]
endif
if host_machine.system() != 'darwin'

View File

@ -4,12 +4,14 @@
#include <glib.h>
#ifndef HAVE_POLKIT_AUTOPTR
# include <polkit/polkit.h>
#ifdef HAVE_POLKIT
# ifndef HAVE_POLKIT_AUTOPTR
# include <polkit/polkit.h>
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthority, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthority, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitAuthorizationResult, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PolkitSubject, g_object_unref)
# endif
#endif
#if !GLIB_CHECK_VERSION(2, 56, 0)

View File

@ -90,7 +90,6 @@ sysprof_capture_symbol_resolver_load (SysprofSymbolResolver *resolver,
SysprofCaptureReader *reader)
{
SysprofCaptureSymbolResolver *self = (SysprofCaptureSymbolResolver *)resolver;
g_autoptr(GError) error = NULL;
gint byte_order;
gint fd;

View File

@ -23,7 +23,6 @@
#include "config.h"
#include <gio/gunixfdlist.h>
#include <polkit/polkit.h>
#include "sysprof-helpers.h"
#include "sysprof-polkit-private.h"
@ -549,7 +548,6 @@ sysprof_helpers_authorize_async (SysprofHelpers *self,
gpointer user_data)
{
g_autoptr(GTask) task = NULL;
g_autoptr(PolkitSubject) subject = NULL;
GDBusConnection *bus;
g_return_if_fail (SYSPROF_IS_HELPERS (self));

View File

@ -407,9 +407,9 @@ sysprof_local_profiler_class_init (SysprofLocalProfilerClass *klass)
g_object_class_override_property (object_class, PROP_WHOLE_SYSTEM, "whole-system");
g_type_ensure (SYSPROF_TYPE_GJS_SOURCE);
#ifdef __linux__
g_type_ensure (SYSPROF_TYPE_HOSTINFO_SOURCE);
g_type_ensure (SYSPROF_TYPE_PROC_SOURCE);
#ifdef __linux__
g_type_ensure (SYSPROF_TYPE_PERF_SOURCE);
#endif
g_type_ensure (SYSPROF_TYPE_PROXY_SOURCE);