regular delta

This commit is contained in:
Ludwig Lehnert 2025-04-30 18:50:56 +02:00
parent 6e21387ad5
commit 8e3e5477e3
Signed by: ludwig
SSH Key Fingerprint: SHA256:4vshH9GJ8TLO1RS2fY6rDDLnq7+KVvSClCY+uEhYYRA
6 changed files with 43 additions and 3 deletions

2
.gitignore vendored
View File

@ -3,6 +3,8 @@
*.a
*.test
*.obj
*.pdb
*.ilk
build/
plugins_install/

View File

@ -1,10 +1,16 @@
all: compiled\Twice.exe compiled\JustOpen.exe
CC = cl
CFLAGS = /Zi /Od /link /MACHINE:X64
all: compiled\Foo.exe compiled\Twice.exe compiled\JustOpen.exe
clean:
del /Q "compiled\*"
compiled\Foo.exe: source\Foo.c
$(CC) /Fe:$@ source\Foo.c comdlg32.lib $(CFLAGS)
compiled\Twice.exe: source\Twice.c
cl /Fe:$@ source\Twice.c comdlg32.lib /link /MACHINE:X64
$(CC) /Fe:$@ source\Twice.c comdlg32.lib $(CFLAGS)
compiled\JustOpen.exe: source\JustOpen.c
cl /Fe:$@ source\JustOpen.c comdlg32.lib /link /MACHINE:X64
$(CC) /Fe:$@ source\JustOpen.c comdlg32.lib $(CFLAGS)

BIN
programs/compiled/Foo.exe Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

32
programs/source/Foo.c Normal file
View File

@ -0,0 +1,32 @@
#include <stdio.h>
#include <stdlib.h>
int test(int a, int b) {
if (a + b >= 1000) {
fprintf(stderr, "CRITICAL ERROR!!!\n");
exit(1);
}
return a + b;
}
int main(int argc, char **argv) {
if (argc < 3) {
fprintf(stderr, "Usage: %s <a> <b>\n", argv[0]);
exit(1);
}
int a, b;
if (EOF == sscanf(argv[1], "%d", &a)) {
fprintf(stderr, "%s is not a valid integer\n", argv[1]);
exit(1);
}
if (EOF == sscanf(argv[2], "%d", &b)) {
fprintf(stderr, "%s is not a valid integer\n", argv[2]);
exit(1);
}
fprintf(stdout, "%d\n", test(a, b));
return 0;
}