Skip to content

Commit

Permalink
Add workaround for slurm.h inclusion of List datatype
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
grondo committed Jun 26, 2020
1 parent 45ff890 commit bdc38e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion auto-affinity.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
#define __USE_GNU
#include <sched.h>

/* Include list.h before slurm.h since slurm header stole our List type */
#include "lib/list.h"

#include <slurm/slurm.h>
#include <slurm/spank.h>

#include "lib/list.h"
#include "lib/split.h"
#include "lib/fd.h"

Expand Down
3 changes: 2 additions & 1 deletion lib/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down

0 comments on commit bdc38e9

Please sign in to comment.