Browse code

Mercyful Release

Nat! authored on 07-04-2016 12:13:00
Showing 7 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+https://www.mulle-kybernetik.com/repositories/mulle-configuration
0 2
new file mode 100644
... ...
@@ -0,0 +1,11 @@
1
+.DS_Store
2
+*[Bb]uild/
3
+.idea/
4
+.repos/
5
+xcuserdata/
6
+project.xcworkspace/
7
+*.old
8
+.bootstrap.auto/
9
+.bootstrap.local/
10
+dependencies/
11
+mulle-configuration/
0 12
new file mode 100644
... ...
@@ -0,0 +1,277 @@
1
+// !$*UTF8*$!
2
+{
3
+	archiveVersion = 1;
4
+	classes = {
5
+	};
6
+	objectVersion = 46;
7
+	objects = {
8
+
9
+/* Begin PBXAggregateTarget section */
10
+		41998A421CB669A300D18DD8 /* Libraries */ = {
11
+			isa = PBXAggregateTarget;
12
+			buildConfigurationList = 41998A431CB669A300D18DD8 /* Build configuration list for PBXAggregateTarget "Libraries" */;
13
+			buildPhases = (
14
+			);
15
+			dependencies = (
16
+				41998A471CB669B100D18DD8 /* PBXTargetDependency */,
17
+			);
18
+			name = Libraries;
19
+			productName = Libraries;
20
+		};
21
+/* End PBXAggregateTarget section */
22
+
23
+/* Begin PBXBuildFile section */
24
+		41998A2F1CB668C400D18DD8 /* mulle_align.h in Headers */ = {isa = PBXBuildFile; fileRef = 41998A2D1CB668C400D18DD8 /* mulle_align.h */; settings = {ATTRIBUTES = (Public, ); }; };
25
+		41998A301CB668C400D18DD8 /* mulle_vararg.h in Headers */ = {isa = PBXBuildFile; fileRef = 41998A2E1CB668C400D18DD8 /* mulle_vararg.h */; settings = {ATTRIBUTES = (Public, ); }; };
26
+/* End PBXBuildFile section */
27
+
28
+/* Begin PBXContainerItemProxy section */
29
+		41998A461CB669B100D18DD8 /* PBXContainerItemProxy */ = {
30
+			isa = PBXContainerItemProxy;
31
+			containerPortal = 41998A1D1CB668A200D18DD8 /* Project object */;
32
+			proxyType = 1;
33
+			remoteGlobalIDString = 41998A241CB668A200D18DD8;
34
+			remoteInfo = "mulle-vararg";
35
+		};
36
+/* End PBXContainerItemProxy section */
37
+
38
+/* Begin PBXFileReference section */
39
+		41998A251CB668A200D18DD8 /* libmulle-vararg.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libmulle-vararg.a"; sourceTree = BUILT_PRODUCTS_DIR; };
40
+		41998A2D1CB668C400D18DD8 /* mulle_align.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mulle_align.h; sourceTree = "<group>"; };
41
+		41998A2E1CB668C400D18DD8 /* mulle_vararg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mulle_vararg.h; sourceTree = "<group>"; };
42
+		41998A321CB6693400D18DD8 /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = "<group>"; };
43
+		41998A331CB6693400D18DD8 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
44
+		41998A341CB6693400D18DD8 /* DynamicLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DynamicLibrary.xcconfig; sourceTree = "<group>"; };
45
+		41998A351CB6693400D18DD8 /* DynamicLibraryOSX.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DynamicLibraryOSX.xcconfig; sourceTree = "<group>"; };
46
+		41998A361CB6693400D18DD8 /* IOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = IOS.xcconfig; sourceTree = "<group>"; };
47
+		41998A371CB6693400D18DD8 /* Library.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Library.xcconfig; sourceTree = "<group>"; };
48
+		41998A381CB6693400D18DD8 /* OSX.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = OSX.xcconfig; sourceTree = "<group>"; };
49
+		41998A391CB6693400D18DD8 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
50
+		41998A3A1CB6693400D18DD8 /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
51
+		41998A3B1CB6693400D18DD8 /* StaticLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = StaticLibrary.xcconfig; sourceTree = "<group>"; };
52
+		41998A3C1CB6693400D18DD8 /* StaticLibraryIOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = StaticLibraryIOS.xcconfig; sourceTree = "<group>"; };
53
+		41998A3D1CB6693400D18DD8 /* StaticLibraryOSX.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = StaticLibraryOSX.xcconfig; sourceTree = "<group>"; };
54
+		41998A3E1CB6693400D18DD8 /* ToolOSX.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ToolOSX.xcconfig; sourceTree = "<group>"; };
55
+		41998A3F1CB6693400D18DD8 /* _Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = _Common.xcconfig; sourceTree = "<group>"; };
56
+		41998A401CB6693400D18DD8 /* generate-dot.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "generate-dot.sh"; sourceTree = "<group>"; };
57
+		41998A411CB6693400D18DD8 /* update-all-configurations.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "update-all-configurations.sh"; sourceTree = "<group>"; };
58
+/* End PBXFileReference section */
59
+
60
+/* Begin PBXFrameworksBuildPhase section */
61
+		41998A221CB668A200D18DD8 /* Frameworks */ = {
62
+			isa = PBXFrameworksBuildPhase;
63
+			buildActionMask = 2147483647;
64
+			files = (
65
+			);
66
+			runOnlyForDeploymentPostprocessing = 0;
67
+		};
68
+/* End PBXFrameworksBuildPhase section */
69
+
70
+/* Begin PBXGroup section */
71
+		41998A1C1CB668A200D18DD8 = {
72
+			isa = PBXGroup;
73
+			children = (
74
+				41998A311CB6693400D18DD8 /* mulle-configuration */,
75
+				41998A2C1CB668AD00D18DD8 /* src */,
76
+				41998A261CB668A200D18DD8 /* Products */,
77
+			);
78
+			sourceTree = "<group>";
79
+		};
80
+		41998A261CB668A200D18DD8 /* Products */ = {
81
+			isa = PBXGroup;
82
+			children = (
83
+				41998A251CB668A200D18DD8 /* libmulle-vararg.a */,
84
+			);
85
+			name = Products;
86
+			sourceTree = "<group>";
87
+		};
88
+		41998A2C1CB668AD00D18DD8 /* src */ = {
89
+			isa = PBXGroup;
90
+			children = (
91
+				41998A2D1CB668C400D18DD8 /* mulle_align.h */,
92
+				41998A2E1CB668C400D18DD8 /* mulle_vararg.h */,
93
+			);
94
+			path = src;
95
+			sourceTree = "<group>";
96
+		};
97
+		41998A311CB6693400D18DD8 /* mulle-configuration */ = {
98
+			isa = PBXGroup;
99
+			children = (
100
+				41998A321CB6693400D18DD8 /* Common.xcconfig */,
101
+				41998A331CB6693400D18DD8 /* Debug.xcconfig */,
102
+				41998A341CB6693400D18DD8 /* DynamicLibrary.xcconfig */,
103
+				41998A351CB6693400D18DD8 /* DynamicLibraryOSX.xcconfig */,
104
+				41998A361CB6693400D18DD8 /* IOS.xcconfig */,
105
+				41998A371CB6693400D18DD8 /* Library.xcconfig */,
106
+				41998A381CB6693400D18DD8 /* OSX.xcconfig */,
107
+				41998A391CB6693400D18DD8 /* README.md */,
108
+				41998A3A1CB6693400D18DD8 /* Release.xcconfig */,
109
+				41998A3B1CB6693400D18DD8 /* StaticLibrary.xcconfig */,
110
+				41998A3C1CB6693400D18DD8 /* StaticLibraryIOS.xcconfig */,
111
+				41998A3D1CB6693400D18DD8 /* StaticLibraryOSX.xcconfig */,
112
+				41998A3E1CB6693400D18DD8 /* ToolOSX.xcconfig */,
113
+				41998A3F1CB6693400D18DD8 /* _Common.xcconfig */,
114
+				41998A401CB6693400D18DD8 /* generate-dot.sh */,
115
+				41998A411CB6693400D18DD8 /* update-all-configurations.sh */,
116
+			);
117
+			path = "mulle-configuration";
118
+			sourceTree = "<group>";
119
+		};
120
+/* End PBXGroup section */
121
+
122
+/* Begin PBXHeadersBuildPhase section */
123
+		41998A231CB668A200D18DD8 /* Headers */ = {
124
+			isa = PBXHeadersBuildPhase;
125
+			buildActionMask = 2147483647;
126
+			files = (
127
+				41998A2F1CB668C400D18DD8 /* mulle_align.h in Headers */,
128
+				41998A301CB668C400D18DD8 /* mulle_vararg.h in Headers */,
129
+			);
130
+			runOnlyForDeploymentPostprocessing = 0;
131
+		};
132
+/* End PBXHeadersBuildPhase section */
133
+
134
+/* Begin PBXNativeTarget section */
135
+		41998A241CB668A200D18DD8 /* mulle-vararg */ = {
136
+			isa = PBXNativeTarget;
137
+			buildConfigurationList = 41998A291CB668A200D18DD8 /* Build configuration list for PBXNativeTarget "mulle-vararg" */;
138
+			buildPhases = (
139
+				41998A211CB668A200D18DD8 /* Sources */,
140
+				41998A221CB668A200D18DD8 /* Frameworks */,
141
+				41998A231CB668A200D18DD8 /* Headers */,
142
+			);
143
+			buildRules = (
144
+			);
145
+			dependencies = (
146
+			);
147
+			name = "mulle-vararg";
148
+			productName = "mulle-vararg";
149
+			productReference = 41998A251CB668A200D18DD8 /* libmulle-vararg.a */;
150
+			productType = "com.apple.product-type.library.static";
151
+		};
152
+/* End PBXNativeTarget section */
153
+
154
+/* Begin PBXProject section */
155
+		41998A1D1CB668A200D18DD8 /* Project object */ = {
156
+			isa = PBXProject;
157
+			attributes = {
158
+				LastUpgradeCheck = 0720;
159
+				ORGANIZATIONNAME = "Mulle kybernetiK";
160
+				TargetAttributes = {
161
+					41998A241CB668A200D18DD8 = {
162
+						CreatedOnToolsVersion = 7.2.1;
163
+					};
164
+					41998A421CB669A300D18DD8 = {
165
+						CreatedOnToolsVersion = 7.2.1;
166
+					};
167
+				};
168
+			};
169
+			buildConfigurationList = 41998A201CB668A200D18DD8 /* Build configuration list for PBXProject "mulle-vararg" */;
170
+			compatibilityVersion = "Xcode 3.2";
171
+			developmentRegion = English;
172
+			hasScannedForEncodings = 0;
173
+			knownRegions = (
174
+				en,
175
+			);
176
+			mainGroup = 41998A1C1CB668A200D18DD8;
177
+			productRefGroup = 41998A261CB668A200D18DD8 /* Products */;
178
+			projectDirPath = "";
179
+			projectRoot = "";
180
+			targets = (
181
+				41998A421CB669A300D18DD8 /* Libraries */,
182
+				41998A241CB668A200D18DD8 /* mulle-vararg */,
183
+			);
184
+		};
185
+/* End PBXProject section */
186
+
187
+/* Begin PBXSourcesBuildPhase section */
188
+		41998A211CB668A200D18DD8 /* Sources */ = {
189
+			isa = PBXSourcesBuildPhase;
190
+			buildActionMask = 2147483647;
191
+			files = (
192
+			);
193
+			runOnlyForDeploymentPostprocessing = 0;
194
+		};
195
+/* End PBXSourcesBuildPhase section */
196
+
197
+/* Begin PBXTargetDependency section */
198
+		41998A471CB669B100D18DD8 /* PBXTargetDependency */ = {
199
+			isa = PBXTargetDependency;
200
+			target = 41998A241CB668A200D18DD8 /* mulle-vararg */;
201
+			targetProxy = 41998A461CB669B100D18DD8 /* PBXContainerItemProxy */;
202
+		};
203
+/* End PBXTargetDependency section */
204
+
205
+/* Begin XCBuildConfiguration section */
206
+		41998A271CB668A200D18DD8 /* Debug */ = {
207
+			isa = XCBuildConfiguration;
208
+			baseConfigurationReference = 41998A331CB6693400D18DD8 /* Debug.xcconfig */;
209
+			buildSettings = {
210
+			};
211
+			name = Debug;
212
+		};
213
+		41998A281CB668A200D18DD8 /* Release */ = {
214
+			isa = XCBuildConfiguration;
215
+			baseConfigurationReference = 41998A3A1CB6693400D18DD8 /* Release.xcconfig */;
216
+			buildSettings = {
217
+			};
218
+			name = Release;
219
+		};
220
+		41998A2A1CB668A200D18DD8 /* Debug */ = {
221
+			isa = XCBuildConfiguration;
222
+			baseConfigurationReference = 41998A3D1CB6693400D18DD8 /* StaticLibraryOSX.xcconfig */;
223
+			buildSettings = {
224
+			};
225
+			name = Debug;
226
+		};
227
+		41998A2B1CB668A200D18DD8 /* Release */ = {
228
+			isa = XCBuildConfiguration;
229
+			baseConfigurationReference = 41998A3D1CB6693400D18DD8 /* StaticLibraryOSX.xcconfig */;
230
+			buildSettings = {
231
+			};
232
+			name = Release;
233
+		};
234
+		41998A441CB669A300D18DD8 /* Debug */ = {
235
+			isa = XCBuildConfiguration;
236
+			buildSettings = {
237
+			};
238
+			name = Debug;
239
+		};
240
+		41998A451CB669A300D18DD8 /* Release */ = {
241
+			isa = XCBuildConfiguration;
242
+			buildSettings = {
243
+			};
244
+			name = Release;
245
+		};
246
+/* End XCBuildConfiguration section */
247
+
248
+/* Begin XCConfigurationList section */
249
+		41998A201CB668A200D18DD8 /* Build configuration list for PBXProject "mulle-vararg" */ = {
250
+			isa = XCConfigurationList;
251
+			buildConfigurations = (
252
+				41998A271CB668A200D18DD8 /* Debug */,
253
+				41998A281CB668A200D18DD8 /* Release */,
254
+			);
255
+			defaultConfigurationIsVisible = 0;
256
+			defaultConfigurationName = Release;
257
+		};
258
+		41998A291CB668A200D18DD8 /* Build configuration list for PBXNativeTarget "mulle-vararg" */ = {
259
+			isa = XCConfigurationList;
260
+			buildConfigurations = (
261
+				41998A2A1CB668A200D18DD8 /* Debug */,
262
+				41998A2B1CB668A200D18DD8 /* Release */,
263
+			);
264
+			defaultConfigurationIsVisible = 0;
265
+		};
266
+		41998A431CB669A300D18DD8 /* Build configuration list for PBXAggregateTarget "Libraries" */ = {
267
+			isa = XCConfigurationList;
268
+			buildConfigurations = (
269
+				41998A441CB669A300D18DD8 /* Debug */,
270
+				41998A451CB669A300D18DD8 /* Release */,
271
+			);
272
+			defaultConfigurationIsVisible = 0;
273
+		};
274
+/* End XCConfigurationList section */
275
+	};
276
+	rootObject = 41998A1D1CB668A200D18DD8 /* Project object */;
277
+}
0 278
new file mode 100644
... ...
@@ -0,0 +1,80 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "0720"
4
+   version = "1.3">
5
+   <BuildAction
6
+      parallelizeBuildables = "YES"
7
+      buildImplicitDependencies = "YES">
8
+      <BuildActionEntries>
9
+         <BuildActionEntry
10
+            buildForTesting = "YES"
11
+            buildForRunning = "YES"
12
+            buildForProfiling = "YES"
13
+            buildForArchiving = "YES"
14
+            buildForAnalyzing = "YES">
15
+            <BuildableReference
16
+               BuildableIdentifier = "primary"
17
+               BlueprintIdentifier = "41998A421CB669A300D18DD8"
18
+               BuildableName = "Libraries"
19
+               BlueprintName = "Libraries"
20
+               ReferencedContainer = "container:mulle-vararg.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
23
+      </BuildActionEntries>
24
+   </BuildAction>
25
+   <TestAction
26
+      buildConfiguration = "Debug"
27
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+      shouldUseLaunchSchemeArgsEnv = "YES">
30
+      <Testables>
31
+      </Testables>
32
+      <AdditionalOptions>
33
+      </AdditionalOptions>
34
+   </TestAction>
35
+   <LaunchAction
36
+      buildConfiguration = "Debug"
37
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
38
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
39
+      launchStyle = "0"
40
+      useCustomWorkingDirectory = "NO"
41
+      ignoresPersistentStateOnLaunch = "NO"
42
+      debugDocumentVersioning = "YES"
43
+      debugServiceExtension = "internal"
44
+      allowLocationSimulation = "YES">
45
+      <MacroExpansion>
46
+         <BuildableReference
47
+            BuildableIdentifier = "primary"
48
+            BlueprintIdentifier = "41998A421CB669A300D18DD8"
49
+            BuildableName = "Libraries"
50
+            BlueprintName = "Libraries"
51
+            ReferencedContainer = "container:mulle-vararg.xcodeproj">
52
+         </BuildableReference>
53
+      </MacroExpansion>
54
+      <AdditionalOptions>
55
+      </AdditionalOptions>
56
+   </LaunchAction>
57
+   <ProfileAction
58
+      buildConfiguration = "Release"
59
+      shouldUseLaunchSchemeArgsEnv = "YES"
60
+      savedToolIdentifier = ""
61
+      useCustomWorkingDirectory = "NO"
62
+      debugDocumentVersioning = "YES">
63
+      <MacroExpansion>
64
+         <BuildableReference
65
+            BuildableIdentifier = "primary"
66
+            BlueprintIdentifier = "41998A421CB669A300D18DD8"
67
+            BuildableName = "Libraries"
68
+            BlueprintName = "Libraries"
69
+            ReferencedContainer = "container:mulle-vararg.xcodeproj">
70
+         </BuildableReference>
71
+      </MacroExpansion>
72
+   </ProfileAction>
73
+   <AnalyzeAction
74
+      buildConfiguration = "Debug">
75
+   </AnalyzeAction>
76
+   <ArchiveAction
77
+      buildConfiguration = "Release"
78
+      revealArchiveInOrganizer = "YES">
79
+   </ArchiveAction>
80
+</Scheme>
0 81
new file mode 100644
... ...
@@ -0,0 +1,37 @@
1
+//
2
+//  mulle_align.h
3
+//  mulle-objc-runtime
4
+//
5
+//  Created by Nat! on 07.04.16.
6
+//  Copyright © 2016 Mulle kybernetiK. All rights reserved.
7
+//
8
+
9
+#ifndef mulle_align_h__
10
+#define mulle_align_h__
11
+
12
+#include <stdalign.h>
13
+
14
+
15
+__attribute(( const))
16
+static inline uintptr_t   mulle_align( uintptr_t p, unsigned int alignment)
17
+{
18
+   intptr_t   misalignment;
19
+   
20
+   if( alignment)
21
+   {
22
+      misalignment = p % alignment;
23
+      if( misalignment)
24
+         p += alignment - misalignment;
25
+   }
26
+   return( p);
27
+}
28
+
29
+
30
+__attribute(( const))
31
+static inline void   *mulle_align_pointer( void *p, unsigned int alignment)
32
+{
33
+   return( (void *) mulle_align( (uintptr_t) p, alignment));
34
+}
35
+
36
+
37
+#endif /* mulle_align_h */
0 38
new file mode 100644
... ...
@@ -0,0 +1,15 @@
1
+//
2
+//  mulle_vararg.c
3
+//  mulle-vararg
4
+//
5
+//  Created by Nat! on 07.04.16.
6
+//  Copyright © 2016 Mulle kybernetiK. All rights reserved.
7
+//
8
+
9
+#include "mulle_vararg.h"
10
+
11
+#include <stdint.h>
12
+
13
+
14
+// for the linker something to do
15
+uint32_t  __mulle_vararg_version =  MULLE_VARARG_VERSION;
0 16
new file mode 100644
... ...
@@ -0,0 +1,158 @@
1
+//
2
+//  mulle_vararg.h
3
+//  mulle-objc-runtime
4
+//
5
+//  Created by Nat! on 29.10.15.
6
+//  Copyright © 2015 Mulle kybernetiK. All rights reserved.
7
+//
8
+
9
+#ifndef mulle_vararg_h__
10
+#define mulle_vararg_h__
11
+
12
+#include "mulle_align.h"
13
+
14
+#define MULLE_VARARG_VERSION  ((0 << 20) | (0 << 8) | 0)
15
+
16
+
17
+/*
18
+ * -print:(NSString *) format, ...
19
+ * [print:@"%d",  0.1]
20
+ *
21
+ * 32 bit:
22
+ * struct vararg
23
+ * {
24
+ *    NSString *X;    // assume .align 2
25
+ *    double    Y;    // assume .align 8
26
+ * }
27
+ *
28
+ * 00: XXXXXXXX
29
+ * 04: 00000000
30
+ * 08: YYYYYYYY
31
+ * 0A: YYYYYYYY
32
+ *
33
+ * -addIfTrue:(BOOL) flag a:(float) a, ...
34
+ * [addIfTrue:YES a:0.2, 0.3]
35
+ *
36
+ * 32 bit:
37
+ * struct vararg
38
+ * {
39
+ *    BOOL      X;
40
+ *    float     Y;    // assume .align 4
41
+ *    double    Z;    // assume .align 8
42
+ * }
43
+ *
44
+ * 00: XX000000
45
+ * 04: YYYYYYYY
46
+ * 08: ZZZZZZZZ
47
+ * 0A: ZZZZZZZZ
48
+ */
49
+typedef struct
50
+{
51
+   void   *p;
52
+}  mulle_vararg_list;
53
+
54
+
55
+
56
+#define mulle_vararg_start( args, ap)          \
57
+do                                             \
58
+{                                              \
59
+   args.p = &ap;                               \
60
+   args.p = &((char *) args.p)[ sizeof( ap) < sizeof( int) ? sizeof( int) : sizeof( ap)];  \
61
+}                                              \
62
+while( 0)
63
+
64
+
65
+// use this for integer types
66
+#define mulle_vararg_next_integer( args, type)              \
67
+({                                                          \
68
+   type   *q;                                               \
69
+                                                            \
70
+   q      = (type *) mulle_align_pointer( args.p, sizeof( type) < sizeof( int) ? alignof( int) : alignof( type)); \
71
+   args.p = &((char *) args.p)[ sizeof( type) < sizeof( int) ? sizeof( int) : sizeof( type)];  \
72
+                                                            \
73
+   (sizeof( type) < sizeof( int) ? (type) *(int *) q : *q); \
74
+})
75
+
76
+
77
+// use this for objects types
78
+#define mulle_vararg_next( args)                                \
79
+({                                                              \
80
+   id   *q;                                                     \
81
+                                                                \
82
+   q      = (id *) mulle_align_pointer( args.p, alignof( id));  \
83
+   args.p = &((char *) args.p)[ sizeof( id)];                   \
84
+                                                                \
85
+   *q;                                                          \
86
+})
87
+
88
+
89
+
90
+// use this for all pointer and id types
91
+#define mulle_vararg_next_pointer( args, type)                  \
92
+({                                                              \
93
+   type   *q;                                                   \
94
+                                                                \
95
+   q      = (type *) mulle_align_pointer( args.p, alignof( void *)); \
96
+   args.p = &((char *) args.p)[ sizeof( void *)];               \
97
+                                                                \
98
+   *q;                                                          \
99
+})
100
+
101
+// synonym
102
+#define mulle_vararg_next_object( args, type)                  \
103
+   mulle_vararg_next_pointer( args, type)
104
+
105
+
106
+// use this for all struct types
107
+#define mulle_vararg_next_struct( args, type)                   \
108
+({                                                              \
109
+   type   *q;                                                   \
110
+                                                                \
111
+   q      = (type *) mulle_align_pointer( args.p, alignof( type)); \
112
+   args.p = &((char *) args.p)[ sizeof( type)];                 \
113
+                                                                \
114
+   *q;                                                          \
115
+})
116
+
117
+
118
+// need separate routine for FP arguments, as float promotes to double
119
+#define mulle_vararg_next_fp( args, type)                         \
120
+({                                                                \
121
+   type   *q;                                                     \
122
+                                                                  \
123
+   q      = (type *) mulle_align_pointer( args.p, sizeof( type) < sizeof( double) ? alignof( double) : alignof( type)); \
124
+   args.p = &((char *) args.p)[ sizeof( type) < sizeof( double) ? sizeof( double) : sizeof( type)]; \
125
+                                                                  \
126
+   (sizeof( type) < sizeof( double) ? (type) *(double *) q : *q); \
127
+})
128
+
129
+
130
+#define mulle_vararg_copy( dst, src)         \
131
+do                                           \
132
+{                                            \
133
+   dst = src;                                \
134
+}                                            \
135
+while( 0)
136
+
137
+#define mulle_vararg_end( args)
138
+
139
+
140
+// only works for objects and pointers
141
+
142
+static inline size_t    mulle_vararg_count( mulle_vararg_list args, void *object)
143
+{
144
+   size_t   count;
145
+   void     *p;
146
+
147
+   count = 0;
148
+   p     = object;
149
+   while( p)
150
+   {
151
+      ++count;
152
+      p = mulle_vararg_next_pointer( args, void *);
153
+   }
154
+   
155
+   return( count);
156
+}
157
+   
158
+#endif /* mulle_vararg_h */