--- libaitsess/inc/aitsess.h 2011/08/21 14:00:43 1.2.2.2 +++ libaitsess/inc/aitsess.h 2011/08/21 14:18:52 1.2.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitsess.h,v 1.2.2.2 2011/08/21 14:00:43 misho Exp $ +* $Id: aitsess.h,v 1.2.2.3 2011/08/21 14:18:52 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -47,6 +47,7 @@ SUCH DAMAGE. #define __AITSESS_H +#include #include #include @@ -226,7 +227,7 @@ inline int ipc_decSemaphore(tagSess * __restrict s); // Lazy macros for lazy programmers :-) by Michael Pounov; Optimizing work with sessions! // -#define DESTROY_SESSION(fname, s) do { \ +#define DESTROY_SESSION(fname, s) do { assert((s)); assert((*s)); \ switch (((*s))->type) { \ case SHARED_IPC: \ ipc_destroySession((fname), (s)); \ @@ -237,7 +238,7 @@ inline int ipc_decSemaphore(tagSess * __restrict s); } \ } while(0) -#define ATTACH_MEMORY(s) do { \ +#define ATTACH_MEMORY(s) do { assert((s)); \ switch ((s)->type) { \ case SHARED_IPC: \ ipc_attachSession((s), 0); \ @@ -248,7 +249,7 @@ inline int ipc_decSemaphore(tagSess * __restrict s); } \ } while(0) -#define DETACH_MEMORY(s) do { \ +#define DETACH_MEMORY(s) do { assert((s)); \ switch ((s)->type) { \ case SHARED_IPC: \ ipc_detachSession((s)); \ @@ -259,7 +260,7 @@ inline int ipc_decSemaphore(tagSess * __restrict s); } \ } while(0) -#define NOT_SEMAPHORE(s) do { \ +#define NOT_SEMAPHORE(s) do { assert((s)); \ switch ((s)->type) { \ case SHARED_IPC: \ ipc_notSemaphore((s)); \ @@ -270,7 +271,7 @@ inline int ipc_decSemaphore(tagSess * __restrict s); } \ } while(0) -#define IS_SEMAPHORED(s, ret) do { \ +#define IS_SEMAPHORED(s, ret) do { assert((s)); \ switch ((s)->type) { \ case SHARED_IPC: \ (ret) = ipc_isSemaphored((s)); \ @@ -283,7 +284,7 @@ inline int ipc_decSemaphore(tagSess * __restrict s); } \ } while(0) -#define ADD_SEMAPHORE(s, ret) do { \ +#define ADD_SEMAPHORE(s, ret) do { assert((s)); \ switch ((s)->type) { \ case SHARED_IPC: \ (ret) = ipc_addSemaphore((s)); \ @@ -296,7 +297,7 @@ inline int ipc_decSemaphore(tagSess * __restrict s); } \ } while(0) -#define DEC_SEMAPHORE(s, ret) do { \ +#define DEC_SEMAPHORE(s, ret) do { assert((s)); \ switch ((s)->type) { \ case SHARED_IPC: \ (ret) = ipc_decSemaphore((s)); \