Skip to content
Permalink
Browse files

Fix cygwin compile issues.

  • Loading branch information...
LordReg committed Oct 18, 2019
1 parent 64bee8a commit 71e41a8cd9baacf50e1f07fb406df53c1cff18c8
Showing with 23 additions and 5 deletions.
  1. +1 −1 lib/swm_hack.c
  2. +16 −0 linux/util.h
  3. +6 −4 spectrwm.c
@@ -63,7 +63,7 @@ static Atom swmws = None, swmpid = None;
void set_property(Display *, Window, Atom, char *);
Atom get_atom_from_string(Display *, char *);

#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) && !defined(__CYGWIN__)
#define DLOPEN(s) RTLD_NEXT
#else
#define DLOPEN(s) dlopen((s), RTLD_GLOBAL | RTLD_LAZY)
@@ -28,3 +28,19 @@ long long strtonum(const char *, long long, long long, const char **);
((tvar) = TAILQ_NEXT(var, field), 1); \
(var) = (tvar))
#endif

#ifndef SIMPLEQ_HEAD
#define SIMPLEQ_HEAD STAILQ_HEAD
#define SIMPLEQ_HEAD_INITIALIZER STAILQ_HEAD_INITIALIZER
#define SIMPLEQ_ENTRY STAILQ_ENTRY
#define SIMPLEQ_INIT STAILQ_INIT
#define SIMPLEQ_INSERT_AFTER STAILQ_INSERT_AFTER
#define SIMPLEQ_INSERT_HEAD STAILQ_INSERT_HEAD
#define SIMPLEQ_INSERT_TAIL STAILQ_INSERT_TAIL
#define SIMPLEQ_EMPTY STAILQ_EMPTY
#define SIMPLEQ_FIRST STAILQ_FIRST
#define SIMPLEQ_REMOVE_AFTER STAILQ_REMOVE_AFTER
#define SIMPLEQ_REMOVE_HEAD STAILQ_REMOVE_HEAD
#define SIMPLEQ_FOREACH STAILQ_FOREACH
#define SIMPLEQ_END(head) NULL
#endif
@@ -12503,17 +12503,17 @@ scan_randr(int idx)
#ifdef SWM_XRR_HAS_CRTC
int i, j;
int ncrtc = 0, nmodes = 0;
#endif /* SWM_XRR_HAS_CRTC */
struct swm_region *r;
int num_screens;
xcb_randr_get_screen_resources_current_cookie_t src;
xcb_randr_get_screen_resources_current_reply_t *srr;
xcb_randr_get_crtc_info_cookie_t cic;
xcb_randr_get_crtc_info_reply_t *cir = NULL;
xcb_randr_crtc_t *crtc;
xcb_randr_mode_info_t *mode;
xcb_screen_t *screen;
int minrate, currate;
#endif /* SWM_XRR_HAS_CRTC */
struct swm_region *r;
int num_screens;
xcb_screen_t *screen;

DNPRINTF(SWM_D_MISC, "screen: %d\n", idx);

@@ -12606,7 +12606,9 @@ scan_randr(int idx)
new_region(&screens[idx], 0, 0, screen->width_in_pixels,
screen->height_in_pixels);

#ifdef SWM_XRR_HAS_CRTC
out:
#endif
/* The screen shouldn't focus on unused regions. */
TAILQ_FOREACH(r, &screens[idx].orl, entry) {
if (screens[idx].r_focus == r)

0 comments on commit 71e41a8

Please sign in to comment.
You can’t perform that action at this time.