Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
define max only when not previously defined (win32 defines it); move xbt_abort to...
[simgrid.git] / include / xbt / misc.h
1 /* $Id$ */
2
3 /* xbt.h - Public interface to the xbt (gras's toolbox)                     */
4
5 /* Copyright (c) 2004 Martin Quinson.                                       */
6 /* Copyright (c) 2004 Arnaud Legrand.                                       */
7 /* All rights reserved.                                                     */
8
9 /* This program is free software; you can redistribute it and/or modify it
10  * under the terms of the license (GNU LGPL) which comes with this package. */
11
12 #ifndef XBT_MISC_H
13 #define XBT_MISC_H
14
15 #ifndef max
16 #  define max(a, b) (((a) > (b))?(a):(b))
17 #endif
18 #ifndef min
19 #  define min(a, b) (((a) < (b))?(a):(b))
20 #endif
21
22 #define TRUE  1
23 #define FALSE 0
24
25 #define XBT_MAX_CHANNEL 10 /* FIXME: killme */
26 /*! C++ users need love */
27 #ifndef BEGIN_DECL
28 # ifdef __cplusplus
29 #  define BEGIN_DECL extern "C" {
30 # else
31 #  define BEGIN_DECL 
32 # endif
33 #endif
34
35 /*! C++ users need love */
36 #ifndef END_DECL
37 # ifdef __cplusplus
38 #  define END_DECL }
39 # else
40 #  define END_DECL 
41 # endif
42 #endif
43 /* End of cruft for C++ */
44
45 BEGIN_DECL
46 /* Dunno where to place this: needed by config and amok */
47 typedef struct {  
48    char *name;
49    int port;
50 } xbt_host_t;
51
52 /* pointer to a function freeing something */
53 typedef   void (void_f_ppvoid_t)(void**);
54 typedef   void (void_f_pvoid_t) (void*);
55
56 /* The following two definitions concern the type of the keys used for
57    the heaps. That should be handled via configure (FIXME). */
58 typedef long double xbt_heap_float_t;
59 #define XBT_HEAP_FLOAT_T "%Lg"  /* for printing purposes */
60
61 typedef long double xbt_maxmin_float_t;
62 #define XBT_MAXMIN_FLOAT_T "%Lg"        /* for printing purposes */
63
64
65 END_DECL
66
67 #endif /* XBT_MISC_H */