Normed stuff

This commit is contained in:
Maieul BOYER 2024-09-04 17:06:41 +00:00
parent 8146ed2176
commit f925aea552
9 changed files with 23 additions and 25 deletions

View file

@ -27,7 +27,8 @@ t_fd *dup_fd(t_fd *fd)
return (NULL); return (NULL);
tmp = dup(fd->fd); tmp = dup(fd->fd);
if (tmp == -1) if (tmp == -1)
return (printf("There was an error while duping the fd %d `%s`\n", fd->fd, fd->name), NULL); return (printf("There was an error while duping the "\
"fd %d `%s`\n", fd->fd, fd->name), NULL);
slot->ty = SLOT_FD; slot->ty = SLOT_FD;
slot->slot.fd.fd = tmp; slot->slot.fd.fd = tmp;
slot->slot.fd.perms = fd->perms; slot->slot.fd.perms = fd->perms;

View file

@ -21,10 +21,6 @@
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef static
# undef static
#endif
t_fd_array *get_fd_arrays(void) t_fd_array *get_fd_arrays(void)
{ {
static t_fd_array val = {}; static t_fd_array val = {};

View file

@ -21,10 +21,6 @@
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef static
# undef static
#endif
t_fd *get_stdin(void) t_fd *get_stdin(void)
{ {
t_fd *out; t_fd *out;

View file

@ -20,10 +20,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#ifdef static
#undef static
#endif
static t_static_buffer *get_next_line_buffer(int fd) static t_static_buffer *get_next_line_buffer(int fd)
{ {
t_usize index; t_usize index;

View file

@ -17,10 +17,6 @@
#include "me/types.h" #include "me/types.h"
#include <stdio.h> #include <stdio.h>
#ifdef static
# undef static
#endif
t_allocator *global_allocator(void) t_allocator *global_allocator(void)
{ {
static t_allocator global_alloc = {}; static t_allocator global_alloc = {};

View file

@ -18,8 +18,18 @@
# define BASE_PATH "/no_base_path_defined/" # define BASE_PATH "/no_base_path_defined/"
#endif #endif
#if defined(PRINT_BACKTRACE) || defined(BACKTRACE_DEEP) #ifdef PRINT_BACKTRACE
// #if true // TO_REMOVE # ifndef _PRINT_BACKTRACE
# define _PRINT_BACKTRACE
# endif
#endif
#ifdef BACKTRACE_DEEP
# ifndef _PRINT_BACKTRACE
# define _PRINT_BACKTRACE
# endif
#endif
#ifdef _PRINT_BACKTRACE
# ifndef BACKTRACE_DEEP # ifndef BACKTRACE_DEEP
# define BACKTRACE_DEEP 256 # define BACKTRACE_DEEP 256
# endif # endif

View file

@ -15,7 +15,14 @@
# define _GNU_SOURCE # define _GNU_SOURCE
# if defined(PRINT_BACKTRACE) || defined(BACKTRACE_DEEP) # ifdef PRINT_BACKTRACE
# include <dlfcn.h>
# include <execinfo.h>
# include <link.h>
# include <stdio.h>
# include <stdlib.h>
# endif
# ifdef BACKTRACE_DEEP
# include <dlfcn.h> # include <dlfcn.h>
# include <execinfo.h> # include <execinfo.h>
# include <link.h> # include <link.h>

View file

@ -17,10 +17,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef static
# undef static
#endif
t_matcher_list *get_matchers(void) t_matcher_list *get_matchers(void)
{ {
static t_matcher_list printf_matchers = (t_matcher_list){ static t_matcher_list printf_matchers = (t_matcher_list){