Похожие чаты

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 ответов

15 просмотров

#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 ?

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

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

А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
131
что насчет пагинга? на осдеве непонятно(
Vi Chapmann 🪙
26
Guys what is ur real (no jokes) expectation of link price during this cycle?
Hobbyist
28
hey everyone I'm not able to input come characters in my flatpak apps, they get ignored by the application. all other non-flatpak apps are fine with these characters. I search...
elo
20
>>> Failed to install app-alternatives/awk-4, Log file: >>> '/var/tmp/portage/app-alternatives/awk-4/temp/build.log' * Messages for package app-alternatives/awk-4: * Pa...
[cocoa] wizzy hell
1
Вопрос я правильно понимаю что в коде newtype ArrowMap k v = ArrowMap { getArrowMap :: k -> Maybe v } getArrowMap есть функция типа k -> Maybe v, если да, то не понимаю задач...
Fedor
64
Hey everyone! How's your weekend going so far?
Noah Noure
17
Hey, it seems like a solid project for the gaming industry. What are your initial thoughts?
Josh
26
Ребят, что лучше для реверса: гидра или ида?
En Vind Av Sorg
26
Делаю велосипед логгер. К сообщению хочу прикрутить некоторую информацию, типа, кем отправлено, какой уровень, и всякое такое. И тут подумалось мне, почему бы не хранить весь...
Serjone
24
Карта сайта