Skip to content

Commit

Permalink
Do not include stdlib.h to avoid conflicts with standard macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
yugr committed Dec 22, 2024
1 parent e85455c commit eb8c91e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/sortchecker.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,20 @@ EXPORT int dlclose(void *handle);
#include <errno.h>

#include <dlfcn.h>
#include <stdlib.h>
#include <syslog.h>
#include <sys/types.h>
#include <unistd.h>
#include <libgen.h>

// We can't include stdlib.h because on some platforms
// it defines macro for APIs below
extern void *malloc(size_t size);
extern void *calloc(size_t nmemb, size_t size);
extern void free(void *ptr);
extern char *getenv(const char *name);
extern void exit(int code);
extern int atexit(void (*function)(void));

// Runtime options
static FILE *out;
static Flags flags = {
Expand Down

0 comments on commit eb8c91e

Please sign in to comment.