From: Adriaan de Jong Date: Sun, 5 Feb 2012 11:51:24 +0000 (+0100) Subject: Moved out of memory prototype to error.h, as the definition is in error.c X-Git-Tag: v2.3-alpha1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b7deeb6632582fcfb23492e77bb09395d1be4ca;p=thirdparty%2Fopenvpn.git Moved out of memory prototype to error.h, as the definition is in error.c Signed-off-by: Adriaan de Jong Acked-by: David Sommerseth Signed-off-by: David Sommerseth --- diff --git a/buffer.h b/buffer.h index e6113f972..6c79007f4 100644 --- a/buffer.h +++ b/buffer.h @@ -26,6 +26,7 @@ #define BUFFER_H #include "basic.h" +#include "error.h" #define BUF_SIZE_MAX 1000000 @@ -810,8 +811,6 @@ gc_reset (struct gc_arena *a) * Allocate memory to hold a structure */ -void out_of_memory (void); - #define ALLOC_OBJ(dptr, type) \ { \ check_malloc_return ((dptr) = (type *) malloc (sizeof (type))); \ @@ -862,7 +861,6 @@ void out_of_memory (void); static inline void check_malloc_return (void *p) { - void out_of_memory (void); if (!p) out_of_memory (); } diff --git a/error.h b/error.h index 13221bd45..aafd0557b 100644 --- a/error.h +++ b/error.h @@ -244,6 +244,9 @@ HANDLE get_orig_stderr (void); /* exit program */ void openvpn_exit (const int status); +/* exit program on out of memory error */ +void out_of_memory (void); + /* * Check the return status of read/write routines. */