Print Page | Close Window

Macro redefinition

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: General Discussion
Forum Description: Topics Related to Visual C++ MFC Development in General
URL: http://forum.codejock.com/forum_posts.asp?TID=15053
Printed Date: 09 July 2024 at 7:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Macro redefinition
Posted By: johnmichael
Subject: Macro redefinition
Date Posted: 27 August 2009 at 6:15am
SAFE_DELETE and SAFE_RELEASE macros are defined by XTPMacros.h

unfortunatly these are very commonly used macro names and just about every api has them. fortunatly almost every other api wraps them in:

#if !defined SAFE_DELETE
#define SAFE_DELETE(x)
   ...
#endif

meaning you dont get these redefinition error. Although you may have specific implementations for the macro's bodies so maybe you should rename them:

XT_SAFE_DELETE
XT_SAFE_RELEASE

to avoid future conflicts while still maintaining the ability to customise the macro body.

regards




Replies:
Posted By: Oleg
Date Posted: 27 August 2009 at 7:26am
Him
 
just add
#undef SAFE_DELETE
before you include toolkit.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: johnmichael
Date Posted: 27 August 2009 at 8:13am
yes I did this but its a hack not a solution. I think the real problem needs to be addressed with the toolkit.

<code>

#if !defined SAFE_DELETE

#endif

</code>

wrappers...


Posted By: Oleg
Date Posted: 28 August 2009 at 4:05am
Hi,
 
Thanks, we will add it.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 28 August 2009 at 8:34am
I'd say the same goes for that other define you have :P (DirectShow I suppose).

-------------
PokerMemento - http://www.pokermemento.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net