Menu

#64 Defining TRUE and FALSE

LTK-CPP
open
nobody
None
5
2010-08-22
2010-08-22
Anonymous
No

I'm trying to use the LLRP CPP Toolkit with Qt and when I try to compile an application I'm working on, I get a long list of warnings from the compiler about redefining TRUE and FALSE. I figured out that this was because both the Qt Platform and the LLRP Toolkit both try to define TRUE and FALSE. I was able to patch the problem by changing ltkcpp_platform-h to check to see if TRUE or FALSE was already defined before defining them.

ltkcpp_platform.h - original

#define FALSE 0
#define TRUE 1

ltkcpp_platform.h - my patch

#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif

Discussion


Log in to post a comment.

MongoDB Logo MongoDB