summaryrefslogtreecommitdiff
path: root/build2/cxx-modules/modtest/foo
blob: 620816b140f9f81dc95561fae42126293b333fc4 (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
51
52
53
54
// file      : foo -*- C++ -*-
// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

// #include <string>

// Define foo module interface.
//
// For VC must be included only into module implementation (foo.cxx). The
// module should be imported into consumer file (with the import declaration).
//
// For CLang must be #included into both module implementation and consumer
// files.
//

#if defined(MODTEST_USE_MODULES) && defined(_MSC_VER)
module foo;
export
{
#endif

// Required by macro isolation test.
//
#ifdef MODTEST_MACRO
# undef MODTEST_MACRO
#endif

#define MODTEST_MACRO 1

int
foo_value (int v);

struct foo
{
  explicit foo (int v);

  int
  value ();

  int
  macro ();

//  std::string
//  message (const char* s) const;

private:
  int v_;
};

// Close module export declaration.
//
#if defined(MODTEST_USE_MODULES) && defined(_MSC_VER)
}
#endif