util: New macro PAD_SIZE.
[sliver-openvswitch.git] / lib / util.h
index c80e8f9..8c4d9d6 100644 (file)
@@ -111,6 +111,9 @@ extern const char *program_name;
 /* Returns X rounded up to the nearest multiple of Y. */
 #define ROUND_UP(X, Y) (DIV_ROUND_UP(X, Y) * (Y))
 
+/* Returns the least number that, when added to X, yields a multiple of Y. */
+#define PAD_SIZE(X, Y) (ROUND_UP(X, Y) - (X))
+
 /* Returns X rounded down to the nearest multiple of Y. */
 #define ROUND_DOWN(X, Y) ((X) / (Y) * (Y))
 
@@ -491,7 +494,9 @@ uint64_t bitwise_get(const void *src, unsigned int src_len,
 
 #ifdef _WIN32
 \f
+char *ovs_format_message(int error);
 char *ovs_lasterror_to_string(void);
+int ftruncate(int fd, off_t length);
 #endif
 
 #ifdef  __cplusplus