10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
+
+
+
|
* the packaging of this file.
*
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#ifndef OBJFW_MACROS_H
#define OBJFW_MACROS_H
#include "objfw-defs.h"
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
-
+
-
+
-
-
-
+
+
+
|
#include <sys/time.h>
#include "platform.h"
#ifdef OF_OBJFW_RUNTIME
# ifdef OF_COMPILING_OBJFW
# import "ObjFWRT.h"
# include "ObjFWRT.h"
# else
# import <ObjFWRT/ObjFWRT.h>
# include <ObjFWRT/ObjFWRT.h>
# endif
#endif
#ifdef OF_APPLE_RUNTIME
# import <objc/objc.h>
# import <objc/runtime.h>
# import <objc/message.h>
# include <objc/objc.h>
# include <objc/runtime.h>
# include <objc/message.h>
#endif
#if defined(__GNUC__)
# define restrict __restrict__
#elif __STDC_VERSION__ < 199901L
# define restrict
#endif
|
884
885
886
887
888
889
890
|
887
888
889
890
891
892
893
894
895
|
+
+
|
struct timeval tv;
gettimeofday(&tv, NULL);
srand((unsigned)(tv.tv_sec ^ tv.tv_usec));
return (((uint32_t)(rand()) << 16) | ((uint32_t)(rand()) & 0xFFFF));
#endif
}
#endif
|