summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2025-09-19 16:54:04 -0400
committerDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2025-09-19 16:55:35 -0400
commit292c5fb43f5402bcbd2c26607543f5bfc815e8e5 (patch)
tree01f558b6b2ede7ea0786f1366a56fec873456ccc /include
parent44aa2be93d86e5bac3768962f4fea14a4b3778d3 (diff)
downloadmath-utils-292c5fb43f5402bcbd2c26607543f5bfc815e8e5.tar.gz
Portability and Bugfixes
Diffstat (limited to 'include')
-rw-r--r--include/cdf.h12
-rw-r--r--include/cumsum.h12
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