summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/libunix.cc25
-rw-r--r--crawl-ref/source/libunix.h4
2 files changed, 16 insertions, 13 deletions
diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc
index 14c6044517..3eb398237b 100644
--- a/crawl-ref/source/libunix.cc
+++ b/crawl-ref/source/libunix.cc
@@ -389,18 +389,6 @@ int itoa(int value, char *strptr, int radix)
}
-// Convert string to lowercase.
-char *strlwr(char *str)
-{
- unsigned int i;
-
- for (i = 0; i < strlen(str); i++)
- str[i] = tolower(str[i]);
-
- return (str);
-}
-
-
int cprintf(const char *format,...)
{
int i;
@@ -704,3 +692,16 @@ int kbhit()
return (i);
}
+
+extern "C" {
+ // Convert string to lowercase.
+ char *strlwr(char *str)
+ {
+ unsigned int i;
+
+ for (i = 0; i < strlen(str); i++)
+ str[i] = tolower(str[i]);
+
+ return (str);
+ }
+}
diff --git a/crawl-ref/source/libunix.h b/crawl-ref/source/libunix.h
index 52ecc4f72b..bcbb864e85 100644
--- a/crawl-ref/source/libunix.h
+++ b/crawl-ref/source/libunix.h
@@ -4,9 +4,10 @@
// Some replacement routines missing in gcc
+#ifndef O_BINARY
#define O_BINARY O_RDWR
+#endif
-char *strlwr(char *str);
char getche(void);
void message_out(int mline, int colour, const char *str, int firstcol = 0,
@@ -56,6 +57,7 @@ extern "C"
int getch(void);
int noecho(void);
int echo(void);
+ char *strlwr(char *str);
}
#endif