Skip to content

Commit ce2fba1

Browse files
committed
Add Platform.hpp
1 parent ce70be6 commit ce2fba1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+153
-31
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ target_include_directories(mrdox-api
9292
PRIVATE
9393
"${PROJECT_SOURCE_DIR}/source/lib/"
9494
)
95+
target_compile_definitions(
96+
mrdox-api
97+
PRIVATE
98+
-DMRDOX_LIB
99+
)
95100

96101
# LLVM
97102
target_link_libraries(mrdox-api PUBLIC ${llvm_libs})
@@ -113,6 +118,7 @@ else()
113118
endif()
114119
target_include_directories(mrdox-api SYSTEM PUBLIC ${CLANG_INCLUDE_DIRS})
115120

121+
116122
# Windows, Win64
117123
if (WIN32)
118124
target_compile_definitions(

include/mrdox/Config.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef MRDOX_CONFIG_HPP
1313
#define MRDOX_CONFIG_HPP
1414

15+
#include <mrdox/Platform.hpp>
1516
#include <mrdox/Reporter.hpp>
1617
#include <clang/Tooling/ArgumentsAdjusters.h>
1718
#include <llvm/ADT/Optional.h>

include/mrdox/Corpus.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef MRDOX_CORPUS_HPP
1313
#define MRDOX_CORPUS_HPP
1414

15+
#include <mrdox/Platform.hpp>
1516
#include <mrdox/Config.hpp>
1617
#include <mrdox/Debug.hpp>
1718
#include <mrdox/MetadataFwd.hpp>

include/mrdox/Debug.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef MRDOX_DEBUG_HPP
1212
#define MRDOX_DEBUG_HPP
1313

14+
#include <mrdox/Platform.hpp>
1415
#if ! defined(NDEBUG)
1516
#include <llvm/Support/ErrorHandling.h>
1617
#endif

include/mrdox/Error.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef MRDOX_ERROR_HPP
1313
#define MRDOX_ERROR_HPP
1414

15+
#include <mrdox/Platform.hpp>
1516
#include <llvm/Support/Error.h>
1617
#include <llvm/Support/raw_ostream.h>
1718
#include <source_location>

include/mrdox/Generator.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef MRDOX_GENERATOR_HPP
1616
#define MRDOX_GENERATOR_HPP
1717

18+
#include <mrdox/Platform.hpp>
1819
#include <mrdox/Config.hpp>
1920
#include <mrdox/Corpus.hpp>
2021
#include <mrdox/Reporter.hpp>

include/mrdox/Generators.hpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// Licensed under the Apache License v2.0 with LLVM Exceptions.
3+
// See https://llvm.org/LICENSE.txt for license information.
4+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
//
6+
// Copyright (c) 2023 Vinnie Falco ([email protected])
7+
//
8+
// Official repository: https://github.com/cppalliance/mrdox
9+
//
10+
11+
#ifndef MRDOX_GENERATORS_HPP
12+
#define MRDOX_GENERATORS_HPP
13+
14+
#include <mrdox/Platform.hpp>
15+
16+
namespace clang {
17+
namespace mrdox {
18+
19+
/** A dynamic list of Generator
20+
*/
21+
class Generators
22+
{
23+
Generators() noexcept;
24+
25+
public:
26+
/** Destructor.
27+
*/
28+
virtual ~Generators() = default;
29+
};
30+
31+
} // mrdox
32+
} // clang
33+
34+
#endif

include/mrdox/Metadata.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef MRDOX_METADATA_HPP
1313
#define MRDOX_METADATA_HPP
1414

15+
#include <mrdox/Platform.hpp>
16+
1517
// All headers related to
1618
// metadata extracted from AST
1719

include/mrdox/MetadataFwd.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
#ifndef MRDOX_METADATA_FWD_HPP
1313
#define MRDOX_METADATA_FWD_HPP
1414

15+
#include <mrdox/Platform.hpp>
16+
#include <mrdox/meta/Symbols.hpp>
17+
1518
// Forward declarations for all types
1619
// related to metadata extracted from AST
1720

18-
#include <mrdox/meta/Symbols.hpp>
19-
2021
namespace clang {
2122
namespace mrdox {
2223

include/mrdox/Platform.hpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// Licensed under the Apache License v2.0 with LLVM Exceptions.
3+
// See https://llvm.org/LICENSE.txt for license information.
4+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
//
6+
// Copyright (c) 2023 Vinnie Falco ([email protected])
7+
//
8+
// Official repository: https://github.com/cppalliance/mrdox
9+
//
10+
11+
#ifndef MRDOX_PLATFORM_HPP
12+
#define MRDOX_PLATFORM_HPP
13+
14+
/*
15+
Platform-specific things, and stuff
16+
that is dependent on the toolchain.
17+
*/
18+
19+
namespace clang {
20+
namespace mrdox {
21+
22+
// MSVC
23+
#if defined(_MSC_VER)
24+
# define MRDOX_SYMBOL_EXPORT __declspec(dllexport)
25+
# define MRDOX_SYMBOL_IMPORT __declspec(dllimport)
26+
# define MRDOX_SYMBOL_VISIBLE
27+
# if defined(MRDOX_LIB) // building library
28+
# define MRDOX_DECL MRDOX_SYMBOL_EXPORT
29+
# else
30+
# define MRDOX_DECL MRDOX_SYMBOL_IMPORT
31+
# endif
32+
33+
// (others)
34+
#else
35+
# define MRDOX_SYMBOL_EXPORT
36+
# define MRDOX_SYMBOL_IMPORT
37+
# define MRDOX_SYMBOL_VISIBLE
38+
# define MRDOX_DECL
39+
#endif
40+
41+
} // mrdox
42+
} // clang
43+
44+
#endif

0 commit comments

Comments
 (0)