mirror of
https://github.com/Noratrieb/libuwuc.git
synced 2026-01-14 11:45:05 +01:00
make errno a static instead of TLS
This commit is contained in:
parent
00f78e9749
commit
7a16d84b25
15 changed files with 57 additions and 55 deletions
|
|
@ -1,9 +1,9 @@
|
|||
#include<stdio.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
char *self = argv[0];
|
||||
char first = self[0];
|
||||
if (first != '/') {
|
||||
return 1;
|
||||
}
|
||||
int main(int argc, char *argv[]) {
|
||||
char *self = argv[0];
|
||||
char first = self[0];
|
||||
if (first != '/') {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
//@ignore doens't initialize fs yet
|
||||
#include<errno.h>
|
||||
#include <errno.h>
|
||||
|
||||
int main(void) {
|
||||
int err = errno;
|
||||
return err;
|
||||
}
|
||||
int err = errno;
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
char *env = getenv("PATH");
|
||||
if (!env) {
|
||||
return 1;
|
||||
}
|
||||
char *env = getenv("PATH");
|
||||
if (!env) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *env2 = getenv("__some absolutely NONSENSE that no one would ever define please..");
|
||||
if (env2) {
|
||||
return 1;
|
||||
}
|
||||
char *env2 = getenv(
|
||||
"__some absolutely NONSENSE that no one would ever define please..");
|
||||
if (env2) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include<stdlib.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char *alloc = (char*) malloc(10);
|
||||
*alloc = 1;
|
||||
*(alloc + 9) = 2;
|
||||
free(alloc);
|
||||
char *alloc = (char *)malloc(10);
|
||||
*alloc = 1;
|
||||
*(alloc + 9) = 2;
|
||||
free(alloc);
|
||||
}
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
#include<string.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void) {
|
||||
char buf[10];
|
||||
char buf[10];
|
||||
|
||||
memset(buf, 34, sizeof(buf));
|
||||
memset(buf, 34, sizeof(buf));
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
if (buf[i] != 34) {
|
||||
return 1;
|
||||
}
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
if (buf[i] != 34) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#include<stdio.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int result = printf("Hello, world!\n");
|
||||
if (result != 14) {
|
||||
return 1;
|
||||
}
|
||||
int result = printf("Hello, world!\n");
|
||||
if (result != 14) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#include<stdlib.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
char *str = "12";
|
||||
long value = strtol(str, NULL, 10);
|
||||
if (value != 12) {
|
||||
return 1;
|
||||
}
|
||||
char *str = "12";
|
||||
long value = strtol(str, NULL, 10);
|
||||
if (value != 12) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue