libsyncml  0.5.4
syncml_internals.h
1 /*
2  * libsyncml - A syncml protocol implementation
3  * Copyright (C) 2005 Armin Bauer <armin.bauer@opensync.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  */
20 
40 
41 #ifndef _SYNCML_INTERNALS_H
42 #define _SYNCML_INTERNALS_H
43 
44 #include <glib.h>
45 /* FIXME: Do we need this include? */
46 /* #include <glib-object.h> */
47 #include <string.h>
48 #include <glib/gprintf.h>
49 #include <sys/stat.h>
50 #include <stdint.h>
51 #include <stddef.h>
52 #include <stdlib.h>
53 
54 #include "config.h"
55 
56 #include <errno.h>
57 extern int errno;
58 
59 #if defined(sun) && defined(__SVR4)
60 #define __FUNCTION__ __func__
61 #endif
62 
63 #define smlAssert(x) if (!(x)) { fprintf(stderr, "%s:%i:E:%s: Assertion \"" #x "\" failed\n", __FILE__, __LINE__, __FUNCTION__); abort();}
64 #define smlAssertMsg(x, msg) if (!(x)) { fprintf(stderr, "%s:%i:E:%s: %s\n", __FILE__, __LINE__, __FUNCTION__, msg); abort();}
65 #define segfault_me char **blablabla = NULL; *blablabla = "test";
66 
67 #define return_if_fail(condition) do { \
68  if (!(condition)) { \
69  return; \
70  } } while (0)
71 
72 #define return_val_if_fail(condition, val) do { \
73  if (!(condition)) { \
74  return (val); \
75  } } while (0)
76 
77 #include "sml_support.h"
78 #include "sml_parse.h"
79 
80 #endif
81