User forums > Using Code::Blocks
lost sqT(n)
(1/1)
mmkider:
#if defined(_MSC_VER) || defined(__BORLANDC__)
#include <tchar.h>
#ifndef UNICODE
#define SCSNPRINTF _snprintf
#define SCPUTS puts
#else
#define SCSNPRINTF _snwprintf
#define SCPUTS _putws
#endif
#define sqT(n) _T(n) //<== lost this
#else
// C::B patch: Convert conflicting _T() to sqT() --> applies to nearly *all* files!
// #define _T(n) n
#define sqT(n) n
#define SCSNPRINTF snprintf
#include <stdio.h> // for snprintf
#define SCPUTS puts
#endif
thomas:
Can you explain what that conflict is, please? I'd think that if there was such a conflict with Sqplus , it shouldn't compile, which it does, however. If _T() wasn't working, I'd expect a million error messages from pretty much every place that uses wxString in Unicode builds (which is default).
mmkider:
sorry
It is my fault
#if defined(_MSC_VER) || defined(__BORLANDC__)
#include <tchar.h>
#ifndef UNICODE
#define SCSNPRINTF _snprintf
#define SCPUTS puts
#else
#define SCSNPRINTF _snwprintf
#define SCPUTS _putws
#endif
#ifdef _UNICODE
#define sqT(n) _T(n)
#else
#define sqT(n) (n)
#endif
#else
// C::B patch: Convert conflicting _T() to sqT() --> applies to nearly *all* files!
// #define _T(n) n
#define sqT(n) n
#define SCSNPRINTF snprintf
#include <stdio.h> // for snprintf
#define SCPUTS puts
#endif
stahta01:
From where you say the problem is you must be compiling with MSVC or Borland C; I have no idea if Code::Blocks accepts patches to Code::Blocks for building under anything but GCC.
But, I think that you need to post an patch file instead of code snippets to proceed. Also, good idea to say what problem is being fixed.
@thomas here's an patch that adds the code that is missing; it should only be complied by MSVC or Borland C, so would not normally affect CodeBlocks.
--- Code: ---Index: src/include/scripting/sqplus/sqplus.h
===================================================================
--- src/include/scripting/sqplus/sqplus.h (revision 5295)
+++ src/include/scripting/sqplus/sqplus.h (working copy)
@@ -32,6 +32,7 @@
#define SCSNPRINTF _snwprintf
#define SCPUTS _putws
#endif
+ #define sqT(n) n
#else
// C::B patch: Convert conflicting _T() to sqT() --> applies to nearly *all* files!
// #define _T(n) n
--- End code ---
Tim S
mmkider:
sqplus.h
--- Code: ---#if defined(_MSC_VER) || defined(__BORLANDC__)
#include <tchar.h>
#ifndef UNICODE
#define SCSNPRINTF _snprintf
#define SCPUTS puts
#else
#define SCSNPRINTF _snwprintf
#define SCPUTS _putws
#endif
#ifdef _UNICODE
#define sqT(n) _T(n)
#else
#define sqT(n) (n)
#endif
#else
// C::B patch: Convert conflicting _T() to sqT() --> applies to nearly *all* files!
// #define _T(n) n
#define sqT(n) n
#define SCSNPRINTF snprintf
#include <stdio.h> // for snprintf
#define SCPUTS puts
#endif
--- End code ---
sqstdio.h
--- Code: ---SQFILE sqstd_fopen(const SQChar *filename ,const SQChar *mode)
{
// C::B patch: Comment out Unicode stuff
#ifndef SQUNICODE
return (SQFILE)fopen(filename,mode);
#else
return (SQFILE)_wfopen(filename,mode);
#endif
}
--- End code ---
squirrel.h
--- Code: ---// C::B patch: Comment out Unicode stuff
#ifdef _UNICODE
#define SQUNICODE
#endif
--- End code ---
ya, I now try move codeblocks source into vs2005,so I get some trouble.
I choose unicode in vs2005, I get more errors in libsqplus and libsqstdlib
but I try compiling codeblocks code for mingw and got some error for fix code.
sorry, forgot this post.Thx
Navigation
[0] Message Index
Go to full version