From bdc38e922f13505906995d2e7a79cf27782f33e2 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Wed, 6 Jun 2018 10:13:54 -0700 Subject: [PATCH] Add workaround for slurm.h inclusion of List datatype Later Slurm versions export @dun's List datatype verbatim in their public header file. Unfortunately, this breaks any code that uses list.h and also tries to include slurm.h. The only viable workaround for now seems to be setting the __list_datatypes_defined preprocessor define where needed to avoid the slurm.h header redefining the List type. Luckily, this seems to be only in one spot for now. --- auto-affinity.c | 4 +++- lib/list.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/auto-affinity.c b/auto-affinity.c index f60e8b8..1881144 100644 --- a/auto-affinity.c +++ b/auto-affinity.c @@ -33,10 +33,12 @@ #define __USE_GNU #include +/* Include list.h before slurm.h since slurm header stole our List type */ +#include "lib/list.h" + #include #include -#include "lib/list.h" #include "lib/split.h" #include "lib/fd.h" diff --git a/lib/list.h b/lib/list.h index b031fc7..67b061d 100644 --- a/lib/list.h +++ b/lib/list.h @@ -25,7 +25,8 @@ #ifndef LSD_LIST_H #define LSD_LIST_H - +/* Depressing workaround for slurm.h inclusion of our List typedef */ +#define __list_datatypes_defined /*********** * Notes *