Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
patchs in pipeline
stahta01:
--- Quote from: BlueHazzard on July 26, 2013, 10:41:36 pm ---The problem with forward declaration is that SQChar can be wchar_t or char... so i have to put a preprocessorswitch
--- End quote ---
I suggest using "TCHAR" in a declaration like below; but, it might not work.
--- Code: ---typedef TCHAR SQChar;
--- End code ---
Should work; but, I am just a C programmer. This not says not to use TCHAR in C++ Headers http://blogs.msdn.com/b/andrewarnottms/archive/2008/02/22/why-you-should-never-use-tchar-in-c-header-files.aspx
TCHAR might required header tchar.h
From tchar.h in MinGW GCC installed with CB 12.11.
--- Quote ---/*
* Use TCHAR instead of char or wchar_t. It will be appropriately translated
* if _UNICODE is correctly defined (or not).
*/
--- End quote ---
Tim S.
PS: I am only a Code::Blocks user; not a CB developer.
MortenMacFly:
--- Quote from: BlueHazzard on July 26, 2013, 10:41:36 pm ---how can i forward declare a type in c++?
--- End quote ---
Oh that was a typedef and not a class?! - Well than there is no easy solution, forward decl will not work.
p2rkw:
struct A; //forward decl
typedef A B;
?
MortenMacFly:
--- Quote from: p2rkw on July 27, 2013, 06:36:54 pm ---struct A; //forward decl
typedef A B;
?
--- End quote ---
Is it that simple? I think I need to have a look at the sources. All my remarks came from the errors when trying to compile all plugins with with the patch.
BlueHazzard:
its like
#ifdef UNICODE
typedef SQChar wchar_t
#else
typedef SQchar unsigned char
#endif
in squirrel.h so no easy solution... We can use a helper file...
greetings
Navigation
[0] Message Index
[*] Previous page
Go to full version