Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-41302: Fix build with system libmpdec
Move definition of UNUSED from modified headers of libmpdec to
_decimal.c itself. This makes the vendored source closer to the
standalone library and fixes build with --with-system-libmpdec.

Tested to build fine with either system libmpdec or the vendored one.
  • Loading branch information
felixonmars committed Jul 15, 2020
commit d7662bd6750c75874cbe06fb5f4650e0da9623b8
5 changes: 5 additions & 0 deletions Modules/_decimal/_decimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@

#define BOUNDS_CHECK(x, MIN, MAX) x = (x < MIN || MAX < x) ? MAX : x

#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif

/* _Py_DEC_MINALLOC >= MPD_MINALLOC */
#define _Py_DEC_MINALLOC 4
Expand Down
6 changes: 0 additions & 6 deletions Modules/_decimal/libmpdec/mpdecimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ extern "C" {
#define MPD_HIDE_SYMBOLS_END
#endif

#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif

#if defined(_MSC_VER)
#include "vccompat.h"
#define EXTINLINE extern inline
Expand Down