Skip to content

Commit

Permalink
#define OPTION_ON "ON"
Browse files Browse the repository at this point in the history
Signed-off-by: jcwchen <jacky82226@gmail.com>
  • Loading branch information
jcwchen committed Oct 19, 2023
1 parent 1bb8f24 commit e528f0d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions onnx/onnx_pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

#ifndef ONNX_ONNX_PB_H
#define ONNX_ONNX_PB_H
#define OPTION_ON "ON"
#define OPTION_OFF "OFF"

// Defines ONNX_EXPORT and ONNX_IMPORT. On Windows, this corresponds to
// different declarations (dllexport and dllimport). On Linux/Mac, it just
// resolves to the same "default visibility" setting.
#if defined(_MSC_VER)
#if (defined(ONNX_BUILD_SHARED_LIBS) && ONNX_BUILD_SHARED_LIBS) || defined(ONNX_BUILD_MAIN_LIB)
#if (defined(ONNX_USE_PROTOBUF_SHARED_LIBS) && ONNX_USE_PROTOBUF_SHARED_LIBS == OPTION_ON) || defined(ONNX_BUILD_MAIN_LIB)
#define ONNX_EXPORT __declspec(dllexport)
#define ONNX_IMPORT __declspec(dllimport)
#else
Expand Down Expand Up @@ -41,7 +43,7 @@
//
// This solution is similar to
// https://github.com/pytorch/pytorch/blob/master/caffe2/core/common.h
#if (defined(ONNX_BUILD_SHARED_LIBS) && ONNX_BUILD_SHARED_LIBS) || defined(ONNX_BUILD_MAIN_LIB)
#if (defined(ONNX_USE_PROTOBUF_SHARED_LIBS) && ONNX_USE_PROTOBUF_SHARED_LIBS == OPTION_ON) || defined(ONNX_BUILD_MAIN_LIB)
#define ONNX_API ONNX_EXPORT
#else
#define ONNX_API ONNX_IMPORT
Expand Down

0 comments on commit e528f0d

Please sign in to comment.