Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[e1db28]: MSVC8Express / GemRB / includes / win32def.h Maximize Restore History

Download this file

win32def.h    114 lines (99 with data), 3.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef WIN32DEF_H
#define WIN32DEF_H
#define MAX_VARIABLE_LENGTH 32
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#if _MSC_VER >= 1000
#pragma message("Microsoft Compiler Version Greater than 1.00")
#pragma warning( disable: 4251 521 )
#endif
#define ADV_TEXT
#include <conio.h>
#ifndef INTERFACE
#define textcolor(i) SetConsoleTextAttribute(hConsole, i)
#else
#define textcolor(i) SetConsoleTextAttribute(hConsole, i)
#endif
#define printf cprintf
#else
#include <stdio.h>
#include <stdlib.h>
#define stricmp strcasecmp
#define strnicmp strncasecmp
// abstract iteration position
struct __POSITION { };
typedef __POSITION* POSITION;
#define BEFORE_START_POSITION ((POSITION)-1L)
#define MYASSERT(f) \
if(!(f)) \
{ \
printf("Assertion failed: %s %d",#f, __LINE__); \
abort(); \
}
struct Plex // warning variable length structure
{
Plex* pNext;
void* data() { return this+1; }
static Plex* Create(Plex*& pHead, unsigned int nMax, unsigned int cbElement)
{
Plex* p = (Plex*) new unsigned char[sizeof(Plex) + nMax * cbElement];
// may throw exception
p->pNext = pHead;
pHead = p; // change head (adds in reverse order for simplicity)
return p;
}
void FreeDataChain()
{// free this one and links
Plex* p = this;
while (p != NULL)
{
unsigned char* bytes = (unsigned char*) p;
Plex* pNext = p->pNext;
delete[] bytes;
p = pNext;
}
}
};
#define ADV_TEXT
#define textcolor(i) i
#endif
#ifdef ADV_TEXT
#ifdef WIN32
#define BLACK 0
#define RED FOREGROUND_RED
#define GREEN FOREGROUND_GREEN
#define BROWN FOREGROUND_GREEN | FOREGROUND_RED
#define BLUE FOREGROUND_BLUE
#define MAGENTA FOREGROUND_RED | FOREGROUND_BLUE
#define CYAN FOREGROUND_BLUE | FOREGROUND_GREEN
#define WHITE FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED
#define LIGHT_RED (RED | FOREGROUND_INTENSITY)
#define LIGHT_GREEN (GREEN | FOREGROUND_INTENSITY)
#define YELLOW (GREEN | RED | FOREGROUND_INTENSITY)
#define LIGHT_BLUE (BLUE | FOREGROUND_INTENSITY)
#define LIGHT_MAGENTA (MAGENTA | FOREGROUND_INTENSITY)
#define LIGHT_CYAN (CYAN | FOREGROUND_INTENSITY)
#define LIGHT_WHITE (WHITE | FOREGROUND_INTENSITY)
#else
#define BLACK printf("\033[0m\033[30m");
#define RED printf("\033[0m\033[31m");
#define GREEN printf("\033[0m\033[32m");
#define BROWN printf("\033[0m\033[33m");
#define BLUE printf("\033[0m\033[34m");
#define MAGENTA printf("\033[0m\033[35m");
#define CYAN printf("\033[0m\033[36m");
#define WHITE printf("\033[0m\033[37m");
#define LIGHT_RED printf("\033[1m\033[31m");
#define LIGHT_GREEN printf("\033[1m\033[32m");
#define YELLOW printf("\033[1m\033[33m");
#define LIGHT_BLUE printf("\033[1m\033[34m");
#define LIGHT_MAGENTA printf("\033[1m\033[35m");
#define LIGHT_CYAN printf("\033[1m\033[36m");
#define LIGHT_WHITE printf("\033[1m\033[37m");
#endif
#define printBracket(status, color) textcolor(WHITE); printf("["); textcolor(color); printf("%s", status); textcolor(WHITE); printf("]")
#define printStatus(status, color) printBracket(status, color); printf("\n")
#define printMessage(owner, message, color) printBracket(owner, LIGHT_WHITE); printf(": "); textcolor(color); printf("%s", message)
#endif
#endif