Refactor __attribute__ usage

Use internal macros for compatibility with non GNUC compilers.
This commit is contained in:
Christian Göttsche
2020-09-09 21:35:15 +02:00
committed by cgzones
parent f4602f7b4e
commit 7107d1db0b
7 changed files with 24 additions and 24 deletions

View File

@ -22,8 +22,6 @@ in the source distribution for its full text.
#include <sys/param.h>
#define _UNUSED_ __attribute__((unused))
static int MIB_hw_physmem[2];
static int MIB_vm_stats_vm_v_page_count[4];
static int pageSize;
@ -377,7 +375,7 @@ void ProcessList_goThroughEntries(ProcessList* this) {
for (int i = 0; i < count; i++) {
struct kinfo_proc* kproc = &kprocs[i];
bool preExisting = false;
bool _UNUSED_ isIdleProcess = false;
bool ATTR_UNUSED isIdleProcess = false;
// note: dragonflybsd kernel processes all have the same pid, so we misuse the kernel thread address to give them a unique identifier
Process* proc = ProcessList_getProcess(this, kproc->kp_ktaddr ? (pid_t)kproc->kp_ktaddr : kproc->kp_pid, &preExisting, (Process_New) DragonFlyBSDProcess_new);

View File

@ -51,8 +51,6 @@ typedef struct DragonFlyBSDProcessList_ {
Hashtable *jails;
} DragonFlyBSDProcessList;
#define _UNUSED_ __attribute__((unused))
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId);
void ProcessList_delete(ProcessList* this);