diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-06-05 11:06:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-06-05 11:06:26 -0400 |
commit | b482c870ca3d70bc5611b8eb447ebbe3418bf3a9 (patch) | |
tree | 653f7663bbe2edd79880a0ddc3579dfb78ae5491 /src/common/util.h | |
parent | 2468a1bd2c3a989c4225897e58b5bf09ac08ba61 (diff) | |
download | tor-b482c870ca3d70bc5611b8eb447ebbe3418bf3a9.tar.gz tor-b482c870ca3d70bc5611b8eb447ebbe3418bf3a9.zip |
Fix some mingw build warnings
These include:
- Having a weird in_addr that can't be initialized with {0}
- Needing INVALID_HANDLE_VALUE instead of -1 for file handles.
- Having a weird dependent definition for struct stat.
- pid is signed, not unsigned.
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index c9754418a0..527dc486f7 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -17,6 +17,10 @@ #include "di_ops.h" #include <stdio.h> #include <stdlib.h> +#ifdef _WIN32 +/* for the correct alias to struct stat */ +#include <sys/stat.h> +#endif #ifndef O_BINARY #define O_BINARY 0 @@ -350,7 +354,9 @@ int write_bytes_to_new_file(const char *fname, const char *str, size_t len, /** Flag for read_file_to_str: it's okay if the file doesn't exist. */ #define RFTS_IGNORE_MISSING 2 +#ifndef _WIN32 struct stat; +#endif char *read_file_to_str(const char *filename, int flags, struct stat *stat_out) ATTR_MALLOC; const char *parse_config_line_from_str(const char *line, |