diff options
-rw-r--r-- | utils/hxascdmp.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/hxascdmp.c b/utils/hxascdmp.c index f5b3492f..1a4105c8 100644 --- a/utils/hxascdmp.c +++ b/utils/hxascdmp.c @@ -46,6 +46,40 @@ static const char * version_str = "1.11 20090420"; #define MAX_LINE_LENGTH 257 +#ifdef SG3_UTILS_MINGW +/* Non Unix OSes distinguish between text and binary files. + Set text mode on fd. Does nothing in Unix. Returns negative number on + failure. */ +int +sg_set_text_mode(int fd) +{ + return setmode(fd, O_TEXT); +} + +/* Set binary mode on fd. Does nothing in Unix. Returns negative number on + failure. */ +int +sg_set_binary_mode(int fd) +{ + return setmode(fd, O_BINARY); +} + +#else +/* For Unix the following functions are dummies. */ +int +sg_set_text_mode(int fd) +{ + return fd; /* fd should be >= 0 */ +} + +int +sg_set_binary_mode(int fd) +{ + return fd; +} +#endif + + static void dStrHex(const char* str, int len, long start) { |