skip to Main Content

My build was working fine in xcode 15.4, after updating to 16.0, this problem is occurring.
Could not find any reference for DarwinFoundation anywhere, any help or suggestion is welcome.

~/Sources/WireGuardKitC/WireGuardKitC.h:10:5 Declaration of ‘u_int32_t’ must be imported from module ‘DarwinFoundation.unsigned_types.u_int32_t’ before it is required

~/Sources/WireGuardKitC/WireGuardKitC.h:14:5 Declaration of ‘u_char’ must be imported from module ‘DarwinFoundation.unsigned_types.u_char’ before it is required

~/Sources/WireGuardKitC/WireGuardKitC.h:16:5 Declaration of ‘u_int16_t’ must be imported from module ‘DarwinFoundation.unsigned_types.u_int16_t’ before it is required

/// WireGuardKitC.h source ///

#include "key.h"
#include "x25519.h"

/* From <sys/kern_control.h> */
#define CTLIOCGINFO 0xc0644e03UL
struct ctl_info {
    u_int32_t   ctl_id;
    char        ctl_name[96];
};
struct sockaddr_ctl {
    u_char      sc_len;
    u_char      sc_family;
    u_int16_t   ss_sysaddr;
    u_int32_t   sc_id;
    u_int32_t   sc_unit;
    u_int32_t   sc_reserved[5];
};

problem was occurring in iOS projects for Wireguard implementation.
It was working fine in Xcode 15.4, stopped working in 16.0.

2

Answers


  1. Chosen as BEST ANSWER

    If anybody is still wandering, just adding

    #import <Foundation/Foundation.h>
    

    at top will fix the issue.


  2. Having the same issue I made the change to this

    struct ctl_info {
        int   ctl_id;
        char        ctl_name[96];
    };
    struct sockaddr_ctl {
        char      sc_len;
        char      sc_family;
        int   ss_sysaddr;
        int   sc_id;
        int   sc_unit;
        int   sc_reserved[5];
    };
    

    hope that help you or at least the next person who gets here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search