Skip to content

Commit

Permalink
options/ansi: gate long long signatures behind C99/C++
Browse files Browse the repository at this point in the history
  • Loading branch information
64 committed Oct 20, 2024
1 parent 6a426ba commit ed5940c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions options/ansi/include/stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ typedef struct {
long quot, rem;
} ldiv_t;

#if defined(__cplusplus) || __STDC_VERSION__ >= 19900L
typedef struct {
long long quot, rem;
} lldiv_t;
#endif

#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
Expand All @@ -41,14 +43,17 @@ typedef struct {
double atof(const char *__string);
int atoi(const char *__string);
long atol(const char *__string);
long long atoll(const char *__string);
double strtod(const char *__restrict __string, char **__restrict __end);
float strtof(const char *__restrict __string, char **__restrict __end);
long double strtold(const char *__restrict __string, char **__restrict __end);
long strtol(const char *__restrict __string, char **__restrict __end, int __base);
long long strtoll(const char *__restrict __string, char **__restrict __end, int __base);
unsigned long strtoul(const char *__restrict __string, char **__restrict __end, int __base);

#if defined(__cplusplus) || __STDC_VERSION__ >= 19900L
long long atoll(const char *__string);
long long strtoll(const char *__restrict __string, char **__restrict __end, int __base);
unsigned long long strtoull(const char *__restrict __string, char **__restrict __end, int __base);
#endif

/* [7.22.2] Pseudo-random sequence generation functions */

Expand Down Expand Up @@ -94,11 +99,14 @@ void qsort_r(void *__base, size_t __nmemb, size_t __size,

int abs(int __number);
long labs(long __number);
long long llabs(long long __number);

div_t div(int __number, int __denom);
ldiv_t ldiv(long __number, long __denom);

#if defined(__cplusplus) || __STDC_VERSION__ >= 19900L
long long llabs(long long __number);
lldiv_t lldiv(long long __number, long long __denom);
#endif

/* [7.22.7] Multibyte character conversion functions */

Expand Down

0 comments on commit ed5940c

Please sign in to comment.