Index: Doxyfile ================================================================== --- Doxyfile +++ Doxyfile @@ -5,10 +5,11 @@ HTML_OUTPUT = . GENERATE_LATEX = NO HIDE_UNDOC_CLASSES = YES HIDE_UNDOC_MEMBERS = YES PREDEFINED = DOXYGEN \ + OF_BOXABLE \ OF_CONSUMED \ OF_DESIGNATED_INITIALIZER \ OF_GENERIC(...)= \ OF_HAVE_BLOCKS \ OF_HAVE_FILES \ Index: src/OFHTTPRequest.h ================================================================== --- src/OFHTTPRequest.h +++ src/OFHTTPRequest.h @@ -53,11 +53,11 @@ * @struct of_http_request_protocol_version_t \ * OFHTTPRequest.h ObjFW/OFHTTPRequest.h * * @brief The HTTP version of the HTTP request. */ -typedef struct { +typedef struct OF_BOXABLE { /*! The major of the HTTP version */ uint8_t major; /*! The minor of the HTTP version */ uint8_t minor; } of_http_request_protocol_version_t; Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -74,11 +74,11 @@ /*! * @struct of_range_t OFObject.h ObjFW/OFObject.h * * @brief A range. */ -typedef struct { +typedef struct OF_BOXABLE { /*! The start of the range */ size_t location; /*! The length of the range */ size_t length; } of_range_t; @@ -106,11 +106,11 @@ /*! * @struct of_point_t OFObject.h ObjFW/OFObject.h * * @brief A point. */ -typedef struct { +typedef struct OF_BOXABLE { /*! The x coordinate of the point */ float x; /*! The y coordinate of the point */ float y; } of_point_t; @@ -133,11 +133,11 @@ /*! * @struct of_dimension_t OFObject.h ObjFW/OFObject.h * * @brief A dimension. */ -typedef struct { +typedef struct OF_BOXABLE { /*! The width of the dimension */ float width; /*! The height of the dimension */ float height; } of_dimension_t; @@ -160,11 +160,11 @@ /*! * @struct of_rectangle_t OFObject.h ObjFW/OFObject.h * * @brief A rectangle. */ -typedef struct { +typedef struct OF_BOXABLE { /*! The point from where the rectangle originates */ of_point_t origin; /*! The size of the rectangle */ of_dimension_t size; } of_rectangle_t; Index: src/OFOptionsParser.h ================================================================== --- src/OFOptionsParser.h +++ src/OFOptionsParser.h @@ -25,11 +25,11 @@ /*! * @struct of_options_parser_option_t OFOptionsParser.h ObjFW/OFOptionsParser.h * * @brief An option which can be parsed by an @ref OFOptionsParser. */ -typedef struct of_options_parser_option_t { +typedef struct { /*! The short version (e.g. `-v`) of the option or `\0` for none. */ of_unichar_t shortOption; /*! * The long version (e.g. `--verbose`) of the option or `nil` for none. Index: src/OFUDPSocket.h ================================================================== --- src/OFUDPSocket.h +++ src/OFUDPSocket.h @@ -29,11 +29,11 @@ /*! * @struct of_udp_socket_address_t OFUDPSocket.h ObjFW/OFUDPSocket.h * * @brief A struct which represents a host / port pair for a UDP socket. */ -typedef struct { +typedef struct OF_BOXABLE { struct sockaddr_storage address; socklen_t length; } of_udp_socket_address_t; #ifdef OF_HAVE_BLOCKS Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -268,10 +268,16 @@ # define OF_DESIGNATED_INITIALIZER \ __attribute__((__objc_designated_initializer__)) #else # define OF_DESIGNATED_INITIALIZER #endif + +#if __has_attribute(__objc_boxable__) +# define OF_BOXABLE __attribute__((__objc_boxable__)) +#else +# define OF_BOXABLE +#endif #if __has_attribute(__swift_name__) # define OF_SWIFT_NAME(name) __attribute__((__swift_name__(name))) #else # define OF_SWIFT_NAME(name)