summaryrefslogtreecommitdiff
path: root/include/event2/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-09-12 14:53:39 -0400
committerNick Mathewson <nickm@torproject.org>2011-09-12 14:53:39 -0400
commit8a2310408faf94ee38f53c04c5e56566d34f7a13 (patch)
treef77647c48288e7818e456a5a8694f5febab0774e /include/event2/util.h
parente20eabd69a43d40d199de6efbddf3105273df19b (diff)
downloadlibevent-8a2310408faf94ee38f53c04c5e56566d34f7a13.tar.gz
Build with large-file support on platforms where it matters
Some hosts require you to define certain options to get a large off_t instead of a small one, to get useful ftell and fseek calls instead of ones that can only support 2GB files, and so on. This patch makes Libevent support those platforms by: * Defining the right options when we build, and * Changing our API so that it does not depend on the platform's definition of off_t. Based on discusion with Michael Herf
Diffstat (limited to 'include/event2/util.h')
-rw-r--r--include/event2/util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/event2/util.h b/include/event2/util.h
index c71fdcf5..2494b384 100644
--- a/include/event2/util.h
+++ b/include/event2/util.h
@@ -193,8 +193,21 @@ extern "C" {
#define ev_ssize_t ssize_t
#endif
+/* Note that we define ev_off_t based on the compile-time size of off_t that
+ * we used to build Libevent, and not based on the current size of off_t.
+ * (For example, we don't define ev_off_t to off_t.). We do this because
+ * some systems let you build your software with different off_t sizes
+ * at runtime, and so putting in any dependency on off_t would risk API
+ * mismatch.
+ */
#ifdef _WIN32
#define ev_off_t ev_int64_t
+#elif _EVENT_SIZEOF_OFF_T == 8
+#define ev_off_t ev_int64_t
+#elif _EVENT_SIZEOF_OFF_T == 4
+#define ev_off_t ev_int32_t
+#elif defined(_EVENT_IN_DOXYGEN)
+#define ev_off_t ...
#else
#define ev_off_t off_t
#endif