2424#ifndef __GNUSTEP_GNUSTEP_H_INCLUDED_
2525#define __GNUSTEP_GNUSTEP_H_INCLUDED_
2626
27- /* Check to see if this is a MINGW build
28- */
29- #if defined(__MINGW32__ ) || defined(__MINGW64__ )
30- # if !defined(__MINGW__ )
31- # define __MINGW__
32- # endif
33- #endif
34-
35- #if !defined(GS_GCC_MINREQ )
36- #if defined(__GNUC__ ) && defined(__GNUC_MINOR__ ) && !defined(__clang__ )
37- # define GS_GCC_MINREQ (maj , min ) \
38- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
39- #else
40- # define GS_GCC_MINREQ (maj , min ) 0
41- #endif
42-
43- #if defined(__clang__ )
44- # define GS_CLANG_MINREQ (maj , min ) \
45- ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
46- #else
47- # define GS_CLANG_MINREQ (maj , min ) 0
48- #endif
49- #endif /* GS_GCC_MINREQ */
27+ #import " GNUstepBase/GSConfig.h"
28+ #import " GNUstepBase/GSVersionMacros.h"
5029
5130/* The contents of this file are designed to be usable with either
5231 * GNUstep-base or MacOS-X Foundation.
@@ -465,9 +444,14 @@ void *__object = (void*)(object);\
465444#define GSLocalizedStaticString (key, comment ) key
466445
467446/* *
447+ * <p>
448+ * This function (macro) is a GNUstep extension.
449+ * </p>
450+ * <p>
468451 * To be used inside a method for making sure that a range does not specify
469452 * anything outside the size of an array/string. Raises exception if range
470453 * extends beyond [0,size]. Size must be an unsigned integer (NSUInteger).
454+ * </p>
471455 */
472456#define GS_RANGE_CHECK (RANGE, SIZE ) \
473457 if (RANGE.location > (NSUInteger )SIZE \
@@ -486,37 +470,40 @@ if ((NSUInteger)INDEX >= (NSUInteger)OVER) \
486470 GSNameFromSelector (_cmd ), (NSUInteger )INDEX]
487471
488472
489- #if defined(__clang__ ) || (GS_GCC_MINREQ (6 ,1 ) && !defined(__MINGW__ ))
490- /** Macro to support fast enumeration on older compilers. The argument are
473+ #if defined(__clang__) \
474+ || (GS_HAVE_FAST_ENUMERATION \
475+ && (GS_HAVE_FAST_ENUMERATION_SETTER || !defined (__MINGW__)))
476+ /* * <p>This function (macro) is a GNUstep extension.</p>
477+ * <p>
478+ * Macro to support fast enumeration on platforms where the compiler or
479+ * runtime do not support fast enumeration directly. The argument are
491480 * a type specification for the value returned by the iteration, the name of
492481 * a variable to hold that value, and the collection to be iterated over
493- * (may also be an instance of [NSEnumerator] rather than a collection).
482+ * (may also be an instance of [NSEnumerator] rather than a collection).<br />
483+ * On a compiler/runtime with fast enumeration support, this macro starts
484+ * the fast enumeration block.
485+ * </p>
494486 */
495487#define GS_FOR_IN (type, var, collection ) \
496488 for (type var in collection)\
497489 {
498- /** Macro to end a fast enumeration block on older compilers. Its argument
499- * must be identical to that of the corresponding GS_FOR_IN macro.
500- * On a more modern compiler this just ends the fast enumeration block.
490+ /* * <p>This function (macro) is a GNUstep extension.</p>
491+ * <p>
492+ * Macro to end a fast enumeration block on older compilers. Its argument
493+ * must be identical to that of the corresponding GS_FOR_IN macro.<br />
494+ * On a compiler/runtime with fast enumeration support, this just ends
495+ * the fast enumeration block.
496+ * </p>
501497 */
502498#define GS_END_FOR (collection ) }
503499#else
504500
505- /* This is the code for the older compilers (and for systems where we can't
506- * override the mutation handling function safely).
507- * We declare the function to be called when a mutation of a collection is
508- * detected during fast enumeration. If possible we use the standard one
509- * provided by the runtime, otherwise we use one provided by GNUstep-base.
501+ /* We declare the function to be called when a mutation of a collection is
502+ * detected during fast enumeration; provided by GNUstep-base.
510503 */
511504#pragma GCC diagnostic push
512505#pragma GCC diagnostic ignored "-Wattributes"
513- #if defined(__MINGW__ )
514- #define USE_GSEnumerationMutation 1 /* Tells NSObject.m */
515506void GSEnumerationMutation (id );
516- #else
517- void objc_enumerationMutation (id );
518- #define GSEnumerationMutation (X ) objc_enumerationMutation(X)
519- #endif
520507#pragma GCC diagnostic pop
521508
522509#define GS_FOR_IN (type, var, c ) \
0 commit comments