Skip to content

Commit

Permalink
Make use of export macros (#749)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Feb 12, 2024
1 parent e341043 commit 6cf16c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/compiler/include/sourcemeta/jsonbinpack/compiler.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#ifndef SOURCEMETA_JSONBINPACK_COMPILER_H_
#define SOURCEMETA_JSONBINPACK_COMPILER_H_

#if defined(__EMSCRIPTEN__) || defined(__Unikraft__)
#define SOURCEMETA_JSONBINPACK_COMPILER_EXPORT
#else
#include "compiler_export.h"
#endif

#include <sourcemeta/jsontoolkit/json.h>
#include <sourcemeta/jsontoolkit/jsonschema.h>

Expand All @@ -9,18 +15,21 @@

namespace sourcemeta::jsonbinpack {

SOURCEMETA_JSONBINPACK_COMPILER_EXPORT
auto compile(sourcemeta::jsontoolkit::JSON &schema,
const sourcemeta::jsontoolkit::SchemaWalker &walker,
const sourcemeta::jsontoolkit::SchemaResolver &resolver,
const std::optional<std::string> &default_dialect = std::nullopt)
-> void;

SOURCEMETA_JSONBINPACK_COMPILER_EXPORT
auto canonicalize(
sourcemeta::jsontoolkit::JSON &schema,
const sourcemeta::jsontoolkit::SchemaWalker &walker,
const sourcemeta::jsontoolkit::SchemaResolver &resolver,
const std::optional<std::string> &default_dialect = std::nullopt) -> void;

SOURCEMETA_JSONBINPACK_COMPILER_EXPORT
auto plan(sourcemeta::jsontoolkit::JSON &schema,
const sourcemeta::jsontoolkit::SchemaWalker &walker,
const sourcemeta::jsontoolkit::SchemaResolver &resolver,
Expand Down
7 changes: 7 additions & 0 deletions src/runtime/include/sourcemeta/jsonbinpack/runtime_parser.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#ifndef SOURCEMETA_JSONBINPACK_RUNTIME_PARSER_H_
#define SOURCEMETA_JSONBINPACK_RUNTIME_PARSER_H_

#if defined(__EMSCRIPTEN__) || defined(__Unikraft__)
#define SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT
#else
#include "runtime_export.h"
#endif

#include <sourcemeta/jsonbinpack/runtime_plan.h>
#include <sourcemeta/jsontoolkit/json.h>

namespace sourcemeta::jsonbinpack {

// TODO: Give this a better name
SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT
auto parse(const sourcemeta::jsontoolkit::JSON &input) -> Plan;

} // namespace sourcemeta::jsonbinpack
Expand Down

0 comments on commit 6cf16c5

Please sign in to comment.