[gnutls-help] Compiling gnutls on solaris

dev dev at cor0.com
Thu Sep 25 16:05:12 CEST 2014

may as well reply to myself as I see the problem and please pardon me
for unrolling the conditional expression in ./lib/x509/verify-high2.c
for the function load_dir_certs() :

int load_dir_certs(const char *dirname,
                          gnutls_x509_trust_list_t list,
                          unsigned int tl_flags, unsigned int tl_vflags,
                          unsigned type, unsigned crl)
        DIR *dirp;
        struct dirent *d;
        int ret;
        int r = 0;
        char path[GNUTLS_PATH_MAX];

        dirp = opendir(dirname);
        if (dirp != NULL) {
                do {
#ifdef _WIN32
                        d = readdir(dirp);
                        if (d != NULL) {
                        struct dirent e;
                        ret = readdir_r(dirp, &e, &d);
                        if ( ret == 0
                                d != NULL
                                        ( d->d_type == DT_REG
                                        d->d_type == DT_LNK
                                        d->d_type == DT_UNKNOWN )
                           ) {

That is borked.

The use of d_type from dirent.h is not portable
as it is a GNUism from linux land only.

No such animal exists in the POSIX dirent.h :


In fact, it never has existed :


so looks like someone in linux land did a GNUism non-portable no no.

therefore :

   CC       verify-high2.lo
 "verify-high2.c", line 312: error: undefined struct/union member:



More information about the Gnutls-help mailing list