git-svn-id: svn://ultimatepp.org/upp/trunk@8429 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-05-11 19:35:48 +00:00
parent 83267af440
commit b7333d579c
6 changed files with 0 additions and 427 deletions

View file

@ -1,27 +0,0 @@
#include <Core/Core.h>
#include <CppBase/CppBase.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
String path = GetDataFile("test.in");
PPSync(GetFileFolder(path));
Cpp cpp;
FileIn in(path);
cpp.Preprocess(path, in, path);
String s = cpp.output;
String opath = GetDataFile("test.out");
LOG("======================");
LOG(cpp.output);
#ifdef flagSAVE
SaveFile(opath, s);
#else
ASSERT(LoadFile(opath) == s);
#endif
LOG("===================== OK");
}

View file

@ -1,14 +0,0 @@
uses
Core,
CppBase;
file
PPTest.cpp,
test.in,
test.out,
help.in;
mainconfig
"" = "",
"" = "SAVE";

View file

@ -1,127 +0,0 @@
#define COMBINE__(a, b) a##b
#define COMBINE(a, b) COMBINE__(a, b)
#define COMBINE3__(a, b, c) a##b##c
#define COMBINE3(a, b, c) COMBINE3__(a, b, c)
#define COMBINE4__(a, b, c, d) a##b##c##d
#define COMBINE4(a, b, c, d) COMBINE4__(a, b, c, d)
#define COMBINE5__(a, b, c, d, e) a##b##c##d##e
#define COMBINE5(a, b, c, d, e) COMBINE5__(a, b, c, d, e)
#define _cm_ ,
#define __countof(a) int(sizeof(a) / sizeof(a[0]))
#define __Expand1(x) x(1)
#define __Expand2(x) __Expand1(x) x(2)
#define __Expand3(x) __Expand2(x) x(3)
#define __Expand4(x) __Expand3(x) x(4)
#define __Expand5(x) __Expand4(x) x(5)
#define __List1(x) x(1)
#define __List2(x) __List1(x), x(2)
#define __List3(x) __List2(x), x(3)
#define __List4(x) __List3(x), x(4)
#define __List5(x) __List4(x), x(5)
#define E__p(I) p##I
#define MK__s__(x) s__s##x
#define MK__s_(x) MK__s__(x)
// #define MK__s MK__s_(__LINE__)
#define MK__s MK__s_(COMBINE3(BLITZ_INDEX__, _, __LINE__))
#define INITBLOCK \
static void COMBINE(MK__s, _fn)(); static UPP::Callinit MK__s(COMBINE(MK__s, _fn), __FILE__, __LINE__); \
static void COMBINE(MK__s, _fn)()
//---------------------------------------------------
#define E__NFValue(I) const Value& COMBINE(p, I)
#define E__NFBody(I) \
String Format(const char *fmt, __List##I(E__NFValue));
__Expand5(E__NFBody)
// =============
INITBLOCK {
Value::SvoRegister<Color>("Color");
}
// =============
#define max (a, b) (a < b ? b : a)
max(12, 23)
max (A, B)
#undef max
#define max(a, b) (a < b ? b : a)
max(12, 23)
max (A, B)
// =============
#define macro something // comment
macro
something
//$- comment
#define mm(a, b, c, d) (d) [c] {b} <a>
mm(1, 2, 3, 4)
mm(1, 2,
3, 4)
mm(1,
2,
3,
4
)
// =============
#define MACRO(x) 123+x
MACRO(
x
)
MACRO(x
)
MACRO(x)
MACRO(x)
MACRO(x
)
// =============
#undef _STCONS
#define _STCONS(ty, name, val) static const ty name = (ty)(val)
_STCONS(float_denorm_style, has_denorm, denorm_absent);
#define InterlockedIncrement16 _InterlockedIncrement16
SHORT
InterlockedIncrement16 (
SHORT volatile *Addend
);

View file

@ -1,5 +0,0 @@
#ifndef _PPTest_icpp_init_stub
#define _PPTest_icpp_init_stub
#include "Core/init"
#include "CppBase/init"
#endif

View file

@ -1,127 +0,0 @@
#define COMBINE__(a, b) a##b
#define COMBINE(a, b) COMBINE__(a, b)
#define COMBINE3__(a, b, c) a##b##c
#define COMBINE3(a, b, c) COMBINE3__(a, b, c)
#define COMBINE4__(a, b, c, d) a##b##c##d
#define COMBINE4(a, b, c, d) COMBINE4__(a, b, c, d)
#define COMBINE5__(a, b, c, d, e) a##b##c##d##e
#define COMBINE5(a, b, c, d, e) COMBINE5__(a, b, c, d, e)
#define _cm_ ,
#define __countof(a) int(sizeof(a) / sizeof(a[0]))
#define __Expand1(x) x(1)
#define __Expand2(x) __Expand1(x) x(2)
#define __Expand3(x) __Expand2(x) x(3)
#define __Expand4(x) __Expand3(x) x(4)
#define __Expand5(x) __Expand4(x) x(5)
#define __List1(x) x(1)
#define __List2(x) __List1(x), x(2)
#define __List3(x) __List2(x), x(3)
#define __List4(x) __List3(x), x(4)
#define __List5(x) __List4(x), x(5)
#define E__p(I) p##I
#define MK__s__(x) s__s##x
#define MK__s_(x) MK__s__(x)
// #define MK__s MK__s_(__LINE__)
#define MK__s MK__s_(COMBINE3(BLITZ_INDEX__, _, __LINE__))
#define INITBLOCK \
static void COMBINE(MK__s, _fn)(); static UPP::Callinit MK__s(COMBINE(MK__s, _fn), __FILE__, __LINE__); \
static void COMBINE(MK__s, _fn)()
//---------------------------------------------------
#define E__NFValue(I) const Value& COMBINE(p, I)
#define E__NFBody(I) \
String Format(const char *fmt, __List##I(E__NFValue));
__Expand5(E__NFBody)
// =============
INITBLOCK {
Value::SvoRegister<Color>("Color");
}
// =============
#define max (a, b) (a < b ? b : a)
max(12, 23)
max (A, B)
#undef max
#define max(a, b) (a < b ? b : a)
max(12, 23)
max (A, B)
// =============
#define macro something // comment
macro
something
//$- comment
#define mm(a, b, c, d) (d) [c] {b} <a>
mm(1, 2, 3, 4)
mm(1, 2,
3, 4)
mm(1,
2,
3,
4
)
// =============
#define MACRO(x) 123+x
MACRO(
x
)
MACRO(x
)
MACRO(x)
MACRO(x)
MACRO(x
)
// =============
#undef _STCONS
#define _STCONS(ty, name, val) static const ty name = (ty)(val)
_STCONS(float_denorm_style, has_denorm, denorm_absent);
#define InterlockedIncrement16 _InterlockedIncrement16
SHORT
InterlockedIncrement16 (
SHORT volatile *Addend
);

View file

@ -1,127 +0,0 @@
#define COMBINE__(a, b) a##b
#define COMBINE(a, b) COMBINE__(a, b)
#define COMBINE3__(a, b, c) a##b##c
#define COMBINE3(a, b, c) COMBINE3__(a, b, c)
#define COMBINE4__(a, b, c, d) a##b##c##d
#define COMBINE4(a, b, c, d) COMBINE4__(a, b, c, d)
#define COMBINE5__(a, b, c, d, e) a##b##c##d##e
#define COMBINE5(a, b, c, d, e) COMBINE5__(a, b, c, d, e)
#define _cm_ ,
#define __countof(a) int(sizeof(a) / sizeof(a[0]))
#define __Expand1(x) x(1)
#define __Expand2(x) __Expand1(x) x(2)
#define __Expand3(x) __Expand2(x) x(3)
#define __Expand4(x) __Expand3(x) x(4)
#define __Expand5(x) __Expand4(x) x(5)
#define __List1(x) x(1)
#define __List2(x) __List1(x), x(2)
#define __List3(x) __List2(x), x(3)
#define __List4(x) __List3(x), x(4)
#define __List5(x) __List4(x), x(5)
#define E__p(I) p##I
#define MK__s__(x) s__s##x
#define MK__s_(x) MK__s__(x)
// #define MK__s MK__s_(__LINE__)
#define MK__s MK__s_(COMBINE3(BLITZ_INDEX__, _, __LINE__))
#define INITBLOCK static void COMBINE(MK__s, _fn)(); static UPP::Callinit MK__s(COMBINE(MK__s, _fn), __FILE__, __LINE__); static void COMBINE(MK__s, _fn)()
//---------------------------------------------------
#define E__NFValue(I) const Value& COMBINE(p, I)
#define E__NFBody(I) String Format(const char *fmt, __List##I(E__NFValue));
String Format(const char *fmt, const Value& p1); String Format(const char *fmt, const Value& p1, const Value& p2); String Format(const char *fmt, const Value& p1, const Value& p2, const Value& p3); String Format(const char *fmt, const Value& p1, const Value& p2, const Value& p3, const Value& p4); String Format(const char *fmt, const Value& p1, const Value& p2, const Value& p3, const Value& p4, const Value& p5);
// =============
 static void s__sBLITZ_INDEX_____LINE___fn(); static UPP::Callinit  s__sBLITZ_INDEX_____LINE__(s__sBLITZ_INDEX_____LINE___fn, __FILE__, __LINE__); static void s__sBLITZ_INDEX_____LINE___fn() {
Value::SvoRegister<Color>("Color");
}
// =============
#define max (a, b) (a < b ? b : a)
 (a, b) (a < b ? b : a)(12, 23)
 (a, b) (a < b ? b : a) (A, B)
#undef max
#define max(a, b) (a < b ? b : a)
(12 < 23 ? 23 : 12)
(A < B ? B : A)
// =============
#define macro something // comment
 something
something
//$- comment
#define mm(a, b, c, d) (d) [c] {b} <a>
(4) [3] {2} <1>
(4) [3] {2} <1>
(4) [3] {2} <1>
// =============
#define MACRO(x) 123+x
123+x
123+x
123+x
123+x
123+x
// =============
#undef _STCONS
#define _STCONS(ty, name, val) static const ty name = (ty)(val)
static const float_denorm_style has_denorm = (float_denorm_style)(denorm_absent);
#define InterlockedIncrement16 _InterlockedIncrement16
SHORT
 _InterlockedIncrement16 (
SHORT volatile *Addend
);