diff options
author | Martin Mares <mj@ucw.cz> | 2014-11-01 16:49:42 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2014-11-01 16:49:42 +0100 |
commit | 35383c120d9452de7062e75ca6372ea7f74fe759 (patch) | |
tree | c00933fc3a47b73f4e99f47af220b864cbb26133 | |
parent | 8d1cb3d74a34971d89602ccd6fc03cf3ab72003a (diff) | |
download | pciutils-35383c120d9452de7062e75ca6372ea7f74fe759.tar.gz |
Better work-around for missing symbol versioning on Darwin
-rw-r--r-- | lib/access.c | 2 | ||||
-rw-r--r-- | lib/internal.h | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/access.c b/lib/access.c index bb5c9ce..c23a2fd 100644 --- a/lib/access.c +++ b/lib/access.c @@ -170,13 +170,11 @@ pci_fill_info_v32(struct pci_dev *d, int flags) /* In version 3.1, pci_fill_info got new flags => versioned alias */ /* In version 3.2, the same has happened */ STATIC_ALIAS(int pci_fill_info(struct pci_dev *d, int flags), pci_fill_info_v32(d, flags)); -#ifndef __APPLE__ DEFINE_ALIAS(int pci_fill_info_v30(struct pci_dev *d, int flags), pci_fill_info_v32); DEFINE_ALIAS(int pci_fill_info_v31(struct pci_dev *d, int flags), pci_fill_info_v32); SYMBOL_VERSION(pci_fill_info_v30, pci_fill_info@LIBPCI_3.0); SYMBOL_VERSION(pci_fill_info_v31, pci_fill_info@LIBPCI_3.1); SYMBOL_VERSION(pci_fill_info_v32, pci_fill_info@@LIBPCI_3.2); -#endif void pci_setup_cache(struct pci_dev *d, byte *cache, int len) diff --git a/lib/internal.h b/lib/internal.h index 03c02f9..de57c5e 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -1,7 +1,7 @@ /* * The PCI Library -- Internal Stuff * - * Copyright (c) 1997--2008 Martin Mares <mj@ucw.cz> + * Copyright (c) 1997--2014 Martin Mares <mj@ucw.cz> * * Can be freely distributed and used under the terms of the GNU GPL. */ @@ -11,12 +11,14 @@ #ifdef PCI_SHARED_LIB #define PCI_ABI __attribute__((visibility("default"))) #ifdef __APPLE__ -#define STATIC_ALIAS(_decl, _for) _decl { return _for; } +#define STATIC_ALIAS(_decl, _for) _decl PCI_ABI { return _for; } +#define DEFINE_ALIAS(_decl, _for) extern _decl __attribute__((alias(#_for))) +#define SYMBOL_VERSION(_int, _ext) asm(".symver " #_int "," #_ext) #else #define STATIC_ALIAS(_decl, _for) +#define DEFINE_ALIAS(_decl, _for) +#define SYMBOL_VERSION(_int, _ext) #endif -#define DEFINE_ALIAS(_decl, _for) extern _decl __attribute__((alias(#_for))) -#define SYMBOL_VERSION(_int, _ext) asm(".symver " #_int "," #_ext) #else #define STATIC_ALIAS(_decl, _for) _decl { return _for; } #define DEFINE_ALIAS(_decl, _for) |