|
@@ -88,6 +88,19 @@ double millitime (nanotime_t tstart, nanotime_t tend) {
|
|
|
|
|
|
// MARK: - Console Functions -
|
|
|
|
|
|
+#ifdef WIN32
|
|
|
+// getline is a POSIX function not available in C on Windows (only C++)
|
|
|
+static ssize_t getline (char **lineptr, size_t *n, FILE *stream) {
|
|
|
+ // to be implemented on Windows
|
|
|
+ // Never use gets: it offers no protections against a buffer overflow vulnerability.
|
|
|
+ // see http://stackoverflow.com/questions/3302255/c-scanf-vs-gets-vs-fgets
|
|
|
+ // we should implement something like ggets here
|
|
|
+ // http://web.archive.org/web/20080525133110/http://cbfalconer.home.att.net/download/
|
|
|
+
|
|
|
+ return -1;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
char *readline (char *prompt, int *length) {
|
|
|
char *line = NULL;
|
|
|
size_t size = 0;
|