Похожие чаты

Hi need help.. how to avoid macro clash... I have boost

and another third party library .. both have clashing macros with variables..

Namespacing is not going to solve it.. do i modify the source in one? Or any better way?

7 ответов

10 просмотров

#include <UNeededHeadear> #undef UNeededDefine #include <NeededHeadear> ?

Yamikani-᥀ Автор вопроса
²
#include <UNeededHeadear> #undef UNeededDefine #in...

This works for one file.. I have a complex project with include dependencies too many to track and fix... Is this the only way?

Yamikani-᥀ Автор вопроса
²
make header wrapper?

Can you give an example

Yamikani ᥀
Can you give an example

cpp #pragma once // Undefine conflicting macro if it's already defined #ifdef CONFLICTING_MACRO #undef CONFLICTING_MACRO #endif #include <boost/some_header.h> // Include the original Boost header cpp #pragma once // Undefine conflicting macro if it's already defined #ifdef CONFLICTING_MACRO #undef CONFLICTING_MACRO #endif #include <third_party/some_header.h> // Include the original ThirdPartyLib header Then, in your project files, #include "boost_wrapper.h" #include "third_party_wrapper.h"

Yamikani-᥀ Автор вопроса
²
cpp #pragma once // Undefine conflicting macro if ...

You mean these two code blocks are im two seprate files ?

Похожие вопросы

Обсуждают сегодня

Anyone here suffers from unexplained aural migraines, who would be up for talking for a bit? Doesn't *have* to be aural, but I am not asking about headaches, I mean actual mi...
Martin Rys
55
We heading to 1.1$ 🤔?
CryptoBo$$
35
A couple thoughts from a random internet stranger: 1. If you want this project to gain traction you cannot keep being negative. If I just came here after finding out about Kd...
Eric Wild
46
Всем здравствуйте!) У меня такой вопрос. Есть два роута, роут1 и роут2. Они связаны с очередью some_queue. По задаче предполагается, что есть два паблиша. Паблиш1 отправляет...
Format
10
i justHey. Im holding kadena almost 3 years now. Its my only investment what isn't in profit. But i thought for years that its just need some more time but i haven't seen that...
Riki
7
Сonst magicTgHTML = (text, entities) => { let processedText = text; let offsetShift = 0; entities.forEach(entity => { const { offset, length, type, url, ...
Андрей
1
Вопрос по WIN32: Насколько я понимаю то все функции win32 привязаны к объектам операционной системы. Например консоль, файл, кисть, окна итд. Следовательно функции win32 упра...
Tommy Vercetti
6
remote nodes with vpn or tor still safe ? (or they can collect other information like amount, receiving/sending adress, .. ?)
Tchoupi
12
кто-то пользуется компонентами rx ? как их лучше ставить, через OPM? (lazarus)
Iluha Companets
15
В смысле более затратная? Общая стоимость владения лошадью меньше, чем автомобиля. В среднем.
Sergej R
10
Карта сайта