source: cpp/gdk/framsg.cpp @ 100

Last change on this file since 100 was 82, checked in by Maciej Komosinski, 12 years ago

compiles under more platforms and OSes

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1#include "framsg.h"
2#include "nonstd_stdio.h"
3
4#ifdef SHP
5#include <FBaseSys.h> //AppLog
6#endif
7
8#ifdef MOBILE2D
9#include <Winbase.h>
10#include "Util.h"
11#endif
12
13static const char *warn="[warn] ";
14static const char *err="[ERROR] ";
15
16/* TODO integracja z error managerem
17void FramMessage(const char *o,const char *m,const char *bl,int w)
18{
19  const char *lvl="";
20  if (w==1) lvl=warn; else if (w>1) lvl=err;
21#ifdef SHP
22  //jesli chcemy zeby nawet w trybie release wysylal komunikaty:
23  //#define AppLog(...)      __App_info(__PRETTY_FUNCTION__ , __LINE__, __VA_ARGS__)
24        AppLog("%s%s::%s - %s\n",lvl,o,m,bl);
25#elif defined MOBILE2D
26        char buf[1000];
27        sprintf(buf,"%s%s::%s - %s\n",lvl,o,m,bl);
28        OutputDebugString(Util::strTOwstr(buf).c_str());
29#else
30        fprintf(w>0?stderr:stdout,"%s%s::%s - %s\n",lvl,o,m,bl);
31#endif
32}
33*/
34
35void FMprintf(const char *o,const char *m,int w,const char *bl, ...)
36{
37   char buf[10000];
38   va_list argptr;
39   va_start(argptr,bl);
40         vsnprintf(buf,10000,bl,argptr);
41         va_end(argptr);
42   FramMessage(o,m,buf,w);
43}
44
45void FMprintf(const char *o,const char *m,int w,const char *bl,va_list va)
46{
47   char buf[10000];
48   vsnprintf(buf,10000,bl,va);
49   FramMessage(o,m,buf,w);
50}
51
52void FMprintf(const char *bl,...)
53{
54        va_list argptr;
55        va_start(argptr,bl);
56        FMprintf("Message","printf",0,bl,argptr);
57        va_end(argptr);
58}
Note: See TracBrowser for help on using the repository browser.