summaryrefslogtreecommitdiffstats
path: root/sandbox/mac/xpc.h
blob: 33d3945e387cf2116705dce227bead9393c24909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file provides forward declarations for XPC symbols that are not
// present in the 10.6 SDK. It uses generate_stubs to produce code to
// dynamically load the libxpc.dylib library and set up a stub table, with
// the same names as the real XPC functions.

#ifndef SANDBOX_MAC_XPC_H_
#define SANDBOX_MAC_XPC_H_

#include <AvailabilityMacros.h>
#include <mach/mach.h>

#include "sandbox/sandbox_export.h"

// Declares XPC object types. This includes <xpc/xpc.h> if available.
#include "sandbox/mac/xpc_stubs_header.fragment"

#if !defined(MAC_OS_X_VERSION_10_7) || \
    MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7

// C++ library loader.
#include "sandbox/mac/xpc_stubs.h"

extern "C" {
// Signatures for XPC public functions that are loaded by xpc_stubs.h.
#include "sandbox/mac/xpc_stubs.sig"
// Signatures for private XPC functions.
#include "sandbox/mac/xpc_private_stubs.sig"
}  // extern "C"

#else

// Signatures for private XPC functions.
extern "C" {
#include "sandbox/mac/xpc_private_stubs.sig"
}  // extern "C"

#endif

namespace sandbox {

// Dynamically loads the XPC library.
bool SANDBOX_EXPORT InitializeXPC();

}  // namespace sandbox

#endif  // SANDBOX_MAC_XPC_H_