Download Pelles C here: http://www.pellesc.se
#include <stdio.h>
#include <stdckdint.h>
char *ab[] = {"false", "true "};
int main(void)
{
long int a = 655350;
long int b = 655350;//10
int c = 0;
bool result;
result = ckd_mul(&c, a, b); // ckd_add(&c, a, b); ckd_sub(&c, a, b);
printf("result: %s c = %d\n", ab[result], c);
result = ckd_add(&c, a, b); // ckd_sub(&c, a, b);
printf("result: %s c = %d\n", ab[result], c);
result = ckd_sub(&c, a, b);
printf("result: %s c = %d\n", ab[result], c);
return 0;
}
#include <stdio.h>
#include <stdckdint.h>
int main(void)
{
long int a = 655350;
long int b = 655350;//10
int c = 0;
//int c = 0;
bool result = true;
result = ckd_mul(&c, a, b); // ckd_add(&c, a, b); ckd_sub(&c, a, b);
if (result == true) {
puts("true\n");
}else{
puts("false\n");
}
printf("c = %d\n", c);
result = ckd_add(&c, a, b); // ckd_sub(&c, a, b);
if (result == true) {
puts("true\n");
}else{
puts("false\n");
}
printf("c = %d\n", c);
result = ckd_sub(&c, a, b);
if (result == true) {
puts("true\n");
}else{
puts("false\n");
}
printf("c = %d\n", c);
return 0;
}Quote from: TimoVJL on March 04, 2026, 05:19:10 PMThose libraries needs a RAD environment too to survive.
Just think what happened to Borland RADs.
Small programs are easy to develop with basic Win32 GUI.

// Boolean type
#if (defined(__STDC__) && __STDC_VERSION__ >= 199901L) || (defined(_MSC_VER) && _MSC_VER >= 1800)
#include <stdbool.h>
#elif !defined(__cplusplus) && !defined(bool)
typedef enum bool { false = 0, true = !false } bool;
#define RL_BOOL_TYPE
#endif
Building main.obj.
C:\SDK\raylib-5.5\include\raylib.h(210): warning #2090: Missing enum tag.
C:\SDK\raylib-5.5\include\raylib.h(210): error #2002: Invalid combination of 'enum' and 'bool'.
C:\SDK\raylib-5.5\include\raylib.h(210): warning #2014: Empty declaration.
C:\SDK\raylib-5.5\include\raylib.h(210): error #2001: Syntax error: expected ';' but found '{'.
C:\SDK\raylib-5.5\include\raylib.h(210): error #2156: Unrecognized declaration.
C:\SDK\raylib-5.5\include\raylib.h(210): warning #2014: Empty declaration.
#pragma comment(lib, "raylibdll.lib")
extern void raylibProc(void);
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
raylibProc();
return 0;
}
#include "raylib.h"
void raylibProc(void)
{
SetTraceLogLevel(LOG_NONE);
InitWindow(800, 450, "raylib hello");
SetTargetFPS(60);
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Hello, raylib!", 190, 200, 40, BLACK);
EndDrawing();
}
CloseWindow();
}
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
static const char g_szClassName[] = "WinGdiHelloBackbufferedClass";
static int g_running = 1;
static HFONT g_font = NULL;
/* Backbuffer objects */
static HDC g_backDC = NULL;
static HBITMAP g_backBmp = NULL;
static HBITMAP g_backOldBmp = NULL;
static int g_backW = 0;
static int g_backH = 0;
static void DestroyBackbuffer(void)
{
if (g_backDC)
{
if (g_backOldBmp)
{
SelectObject(g_backDC, g_backOldBmp);
g_backOldBmp = NULL;
}
if (g_backBmp)
{
DeleteObject(g_backBmp);
g_backBmp = NULL;
}
DeleteDC(g_backDC);
g_backDC = NULL;
}
g_backW = 0;
g_backH = 0;
}
static int EnsureBackbuffer(HWND hwnd, int w, int h)
{
HDC hdcWindow;
HBITMAP newBmp;
if (w <= 0 || h <= 0)
return 0;
if (g_backDC && g_backBmp && g_backW == w && g_backH == h)
return 1;
DestroyBackbuffer();
hdcWindow = GetDC(hwnd);
if (!hdcWindow)
return 0;
g_backDC = CreateCompatibleDC(hdcWindow);
if (!g_backDC)
{
ReleaseDC(hwnd, hdcWindow);
return 0;
}
newBmp = CreateCompatibleBitmap(hdcWindow, w, h);
ReleaseDC(hwnd, hdcWindow);
if (!newBmp)
{
DeleteDC(g_backDC);
g_backDC = NULL;
return 0;
}
g_backBmp = newBmp;
g_backOldBmp = (HBITMAP)SelectObject(g_backDC, g_backBmp);
g_backW = w;
g_backH = h;
return 1;
}
static void RenderSceneToBackbuffer(HWND hwnd)
{
RECT rc;
RECT textRc;
HBRUSH whiteBrush;
GetClientRect(hwnd, &rc);
if (!EnsureBackbuffer(hwnd, rc.right - rc.left, rc.bottom - rc.top))
return;
whiteBrush = (HBRUSH)GetStockObject(WHITE_BRUSH);
FillRect(g_backDC, &rc, whiteBrush);
SetBkMode(g_backDC, TRANSPARENT);
SetTextColor(g_backDC, RGB(0, 0, 0));
if (g_font)
SelectObject(g_backDC, g_font);
SetRect(&textRc, 190, 200, rc.right, rc.bottom);
DrawTextA(g_backDC, "Hello, GDI Backbuffer!", -1, &textRc, DT_LEFT | DT_TOP | DT_SINGLELINE);
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_CREATE:
g_font = CreateFontA(
-40, 0, 0, 0, FW_NORMAL,
FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
"Arial"
);
return 0;
case WM_SIZE:
{
int w = LOWORD(lParam);
int h = HIWORD(lParam);
EnsureBackbuffer(hwnd, w, h);
return 0;
}
case WM_ERASEBKGND:
/* We paint the full frame ourselves from a backbuffer. Prevent default erase flicker. */
return 1;
case WM_KEYDOWN:
if (wParam == VK_ESCAPE)
{
DestroyWindow(hwnd);
return 0;
}
break;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
RenderSceneToBackbuffer(hwnd);
if (g_backDC && g_backBmp)
{
BitBlt(
hdc,
0, 0, g_backW, g_backH,
g_backDC,
0, 0,
SRCCOPY
);
}
EndPaint(hwnd, &ps);
return 0;
}
case WM_DESTROY:
DestroyBackbuffer();
if (g_font)
{
DeleteObject(g_font);
g_font = NULL;
}
g_running = 0;
PostQuitMessage(0);
return 0;
}
return DefWindowProcA(hwnd, msg, wParam, lParam);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSA wc;
HWND hwnd;
RECT wr;
MSG msg;
DWORD frameMs = 1000 / 60;
DWORD lastTick = GetTickCount();
(void)hPrevInstance;
(void)lpCmdLine;
ZeroMemory(&wc, sizeof(wc));
wc.lpfnWndProc = WndProc;
wc.hInstance = hInstance;
wc.lpszClassName = g_szClassName;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL; /* no default brush; we fully repaint */
if (!RegisterClassA(&wc))
return 1;
wr.left = 0;
wr.top = 0;
wr.right = 800;
wr.bottom = 450;
AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);
hwnd = CreateWindowExA(
0,
g_szClassName,
"GDI backbuffer hello",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
wr.right - wr.left,
wr.bottom - wr.top,
NULL, NULL, hInstance, NULL
);
if (!hwnd)
return 1;
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
while (g_running)
{
while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
g_running = 0;
break;
}
TranslateMessage(&msg);
DispatchMessageA(&msg);
}
if (!g_running)
break;
if ((GetTickCount() - lastTick) >= frameMs)
{
lastTick = GetTickCount();
/* Trigger one frame render */
InvalidateRect(hwnd, NULL, FALSE); /* FALSE: do not erase background */
UpdateWindow(hwnd);
}
else
{
Sleep(1);
}
}
return 0;
}
#include <stdio.h>
#include <stdckdint.h>
int main(void)
{
int a = 655350;
int b = 10;
short int c = 0;
//int c = 0;
bool result = true;
result = ckd_mul(&c, a, b); // ckd_add(&c, a, b); ckd_sub(&c, a, b);
if (result == true) {
puts("true\n");
}else{
puts("false\n");
}
printf("c = %d\n", c);
return 0;
}Page created in 0.031 seconds with 11 queries.