File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131#include "binaryninjacore.h"
3232#include "exceptions.h"
3333
34- // intx provides the wide-integer type used by the emulator plugin's API. If a
35- // translation unit includes <windows.h> before this header (as several debugger
36- // adapters do), its min/max macros would break intx's numeric_limits<>::min()/max()
37- // member definitions. Neutralize those macros just for the intx include, then
38- // restore them so any later code that relies on windows.h min/max is unaffected.
39- #if defined(_WIN32)
40- #pragma push_macro("min")
41- #pragma push_macro("max")
42- #undef min
43- #undef max
44- #endif
45- #include "vendor/intx/intx.hpp"
46- #if defined(_WIN32)
47- #pragma pop_macro("min")
48- #pragma pop_macro("max")
49- #endif
50-
5134#include "json/json.h"
5235#include "rapidjsonwrapper.h"
5336#include "vendor/nlohmann/json.hpp"
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright 2020-2026 Vector 35 Inc.
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ */
16+
17+ #pragma once
18+
19+ // intx provides the wide-integer type used throughout the emulator plugin's core and
20+ // API. It lives here (rather than in binaryninjaapi.h) so it is only pulled in by the
21+ // emulator's own headers. If a translation unit includes <windows.h> before this header
22+ // (as several debugger adapters do), its min/max macros would break intx's
23+ // numeric_limits<>::min()/max() member definitions. Neutralize those macros just for the
24+ // intx include, then restore them so any later code relying on windows.h min/max is
25+ // unaffected.
26+ #if defined(_WIN32 )
27+ #pragma push_macro("min")
28+ #pragma push_macro("max")
29+ #undef min
30+ #undef max
31+ #endif
32+ #include "vendor/intx/intx.hpp"
33+ #if defined(_WIN32 )
34+ #pragma pop_macro("min")
35+ #pragma pop_macro("max")
36+ #endif
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
1717#pragma once
1818
1919#include " binaryninjaapi.h"
20+ #include " emulator_intx.h"
2021#include " ffi.h"
2122#include < functional>
2223#include < string>
Original file line number Diff line number Diff line change 11#pragma once
22
33#include " binaryninjaapi.h"
4+ #include " ../api/emulator_intx.h"
45#include " ffi_global.h"
56#include " refcountobject.h"
67#include < atomic>
You can’t perform that action at this time.
0 commit comments