Skip to content

Commit

Permalink
Prevent unused variables from generating warnings across all platform…
Browse files Browse the repository at this point in the history
…s. (onnx#1930)

* Change the return type for the zipmap operator to match the description in the spec.

* Prevent unused variables from generating warnings across all platforms.
This was observed in onnxruntime when __ONNX_NO_DOC_STRINGS was enabled.

* nit change
  • Loading branch information
pranavsharma authored and linkerzhang committed Apr 15, 2019
1 parent 3fb58de commit a8d24ec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions onnx/common/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) ONNX Project Contributors.
// Licensed under the MIT license.

#pragma once

namespace ONNX_NAMESPACE {
#ifdef _WIN32
#define ONNX_UNUSED_PARAMETER(x) (x)
#else
#define ONNX_UNUSED_PARAMETER(x) (void)(x)
#endif
} // namespace ONNX_NAMESPACE
3 changes: 2 additions & 1 deletion onnx/defs/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "data_type_utils.h"
#include "onnx/common/constants.h"
#include "onnx/common/common.h"
#include "onnx/defs/shape_inference.h"
#include "onnx/onnx-operators_pb.h"
namespace ONNX_NAMESPACE {
Expand Down Expand Up @@ -265,7 +266,7 @@ class OpSchema final {
#ifndef __ONNX_NO_DOC_STRINGS
SetDoc(std::string(doc));
#else
doc;
ONNX_UNUSED_PARAMETER(doc);
#endif

return *this;
Expand Down

0 comments on commit a8d24ec

Please sign in to comment.