diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/cdf.h | 12 | ||||
| -rw-r--r-- | include/cumsum.h | 12 |
2 files changed, 10 insertions, 14 deletions
diff --git a/include/cdf.h b/include/cdf.h index 6c218cf..a65caa4 100644 --- a/include/cdf.h +++ b/include/cdf.h @@ -4,6 +4,9 @@ #ifndef H_CDF #define H_CDF +#define _GNU_SOURCE /* Enable getline on Linux */ +#define _POSIX_C_SOURCE 200809L /* Enable POSIX features */ + #include <stdlib.h> #include <unistd.h> #include <stdio.h> @@ -11,6 +14,7 @@ #include <ctype.h> #include <string.h> #include <stdint.h> +#include <inttypes.h> #include <assert.h> typedef union { @@ -28,13 +32,5 @@ static int parse_options(int argc, char*const* argv); static void help(); static int process_data(FILE *file); static DistRecord *expand_array(DistRecord *records, size_t *capacity); -static int read_data_int(DistRecord **records, size_t capacity, FILE *file); -static int read_data_uint(DistRecord **records, size_t capacity, FILE *file); -static int read_data_fp(DistRecord **records, size_t capacity, FILE *file); -static int print_data_fp(DistRecord *records, long double *freqs, size_t cnt); -static int print_data_int(DistRecord *records, long double *freqs, size_t cnt); -static int print_data_uint(DistRecord *records, long double *freqs, size_t cnt); #endif - - diff --git a/include/cumsum.h b/include/cumsum.h index 50ff0b1..1d8387b 100644 --- a/include/cumsum.h +++ b/include/cumsum.h @@ -1,8 +1,11 @@ /* */ -#ifndef H_CDF -#define H_CDF +#ifndef H_CUMSUM +#define H_CUMSUM + +#define _GNU_SOURCE /* Enable getline on Linux */ +#define _POSIX_C_SOURCE 200809L /* Enable POSIX features */ #include <stdlib.h> #include <errno.h> @@ -12,6 +15,7 @@ #include <getopt.h> #include <string.h> #include <stdint.h> +#include <inttypes.h> #include <assert.h> typedef union { @@ -25,10 +29,6 @@ static void help(); static int process_data(FILE *file); static void print_sum(Number sum); -static int read_data_int(FILE *file, Number *num); -static int read_data_uint(FILE *file, Number *num); -static int read_data_fp(FILE *file, Number *num); - #endif |