mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-26 23:22:01 +00:00
9e8a741baa
* mingw64 platform string is like mingw_xxx not "mingw" See https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-python/0099-Change-the-get_platform-method-in-sysconfig-and-dist.patch * Mingw: Do not dllexport exceptions This is a fix for errors like: D:/a/pybind11/pybind11/include/pybind11/detail/common.h:735:23: error: 'dllexport' implies default visibility, but 'class pybind11::builtin_exception' has already been declared with a different visibility 735 | class PYBIND11_EXPORT builtin_exception : public std::runtime_error { | ^~~~~~~~~~~~~~~~~ * GHA: Test Mingw64 build * fix: avoid thin binaries on mingw * fix: drop lto on MinGW * Mingw64: disable PYBIND11_DEPRECATED It trigger many warnings for unknown reasons Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
13 lines
398 B
C++
13 lines
398 B
C++
#pragma once
|
|
#include "pybind11_tests.h"
|
|
#include <stdexcept>
|
|
|
|
// shared exceptions for cross_module_tests
|
|
|
|
class PYBIND11_EXPORT_EXCEPTION shared_exception : public pybind11::builtin_exception {
|
|
public:
|
|
using builtin_exception::builtin_exception;
|
|
explicit shared_exception() : shared_exception("") {}
|
|
void set_error() const override { PyErr_SetString(PyExc_RuntimeError, what()); }
|
|
};
|