Skip to content

Commit

Permalink
Add darwin compatibility fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rb2k authored and Conan-Kudo committed Mar 26, 2021
1 parent dcfffd4 commit 31a8b8b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libdnf/config.h
Expand Up @@ -18,7 +18,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifdef __APPLE__
#include <stdint.h>
#else
#include <bits/wordsize.h>
#endif

#if __WORDSIZE == 32
#include "config-32.h"
Expand Down
4 changes: 4 additions & 0 deletions libdnf/hy-iutil.cpp
Expand Up @@ -22,7 +22,11 @@
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
#ifdef __APPLE__
#include <limits.h>
#else
#include <linux/limits.h>
#endif
#include <pwd.h>
#include <unistd.h>
#include <stdio.h>
Expand Down
16 changes: 16 additions & 0 deletions libdnf/hy-util.cpp
Expand Up @@ -24,7 +24,23 @@
#include <ctype.h>
#include <sys/utsname.h>
#include <sys/stat.h>

#ifdef __APPLE__
typedef int auxv_t;
#ifndef AT_HWCAP2
#define AT_HWCAP2 26
#endif
#ifndef AT_HWCAP
#define AT_HWCAP 16
#endif
static unsigned long getauxval(unsigned long type)
{
unsigned long ret = 0;
return ret;
}
#else
#include <sys/auxv.h>
#endif

// hawkey
#include "dnf-types.h"
Expand Down

0 comments on commit 31a8b8b

Please sign in to comment.