Even more includes

Expand the modulemap to cover some of the system headers too.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-01-20 21:15:20 +00:00
parent 4bdbd48e55
commit f649a949e2
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
27 changed files with 216 additions and 43 deletions

View File

@ -1,3 +1,5 @@
#include <xcb/xcb.h>
#include "backend.h" #include "backend.h"
#include "config.h" #include "config.h"
#include "win.h" #include "win.h"

View File

@ -1,5 +1,7 @@
#include <string.h>
#include <xcb/xcb_image.h> #include <xcb/xcb_image.h>
#include <xcb/render.h> #include <xcb/render.h>
#include <xcb/xcb_renderutil.h>
#include "backend.h" #include "backend.h"
#include "backend_common.h" #include "backend_common.h"

View File

@ -2,14 +2,17 @@
#include <GL/glext.h> #include <GL/glext.h>
#include <locale.h> #include <locale.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <xcb/render.h> // for xcb_render_fixed_t, XXX
#include "common.h" #include "common.h"
#include "compiler.h"
#include "config.h"
#include "log.h" #include "log.h"
#include "region.h" #include "region.h"
#include "string_utils.h" #include "string_utils.h"
#include "utils.h" #include "utils.h"
#include "compiler.h"
#include "config.h"
#include "backend/gl/gl_common.h" #include "backend/gl/gl_common.h"

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include <string.h>
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glext.h> #include <GL/glext.h>

View File

@ -9,9 +9,14 @@
* *
*/ */
#include <assert.h>
#include <GL/glx.h> #include <GL/glx.h>
#include <stdbool.h> #include <stdbool.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/composite.h>
#include <string.h>
#include <stdlib.h>
#include <pixman.h>
#include "backend/backend.h" #include "backend/backend.h"
#include "backend/gl/gl_common.h" #include "backend/gl/gl_common.h"
@ -19,7 +24,6 @@
#include "compiler.h" #include "compiler.h"
#include "log.h" #include "log.h"
#include "region.h" #include "region.h"
#include "string_utils.h"
#include "utils.h" #include "utils.h"
#include "win.h" #include "win.h"
#include "config.h" #include "config.h"

View File

@ -1,8 +1,13 @@
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include <stdlib.h>
#include <string.h>
#include <xcb/xcb.h>
#include <xcb/present.h> #include <xcb/present.h>
#include <xcb/sync.h> #include <xcb/sync.h>
#include <xcb/render.h>
#include <xcb/composite.h>
#include "backend/backend.h" #include "backend/backend.h"
#include "backend_common.h" #include "backend_common.h"

View File

@ -10,6 +10,8 @@
* *
*/ */
#include <string.h>
#include <stdio.h>
#include <fnmatch.h> #include <fnmatch.h>
#include <ctype.h> #include <ctype.h>

View File

@ -9,9 +9,11 @@
* *
*/ */
#include <ctype.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xlib-xcb.h> #include <X11/Xlib-xcb.h>
#include <X11/Xlibint.h> #include <X11/Xlibint.h>
#include <X11/extensions/sync.h> #include <X11/extensions/sync.h>
@ -19,7 +21,10 @@
#include <xcb/present.h> #include <xcb/present.h>
#include <xcb/damage.h> #include <xcb/damage.h>
#include <xcb/render.h> #include <xcb/render.h>
#include <xcb/xcb_image.h> #include <xcb/xfixes.h>
#include <xcb/sync.h>
#include <xcb/composite.h>
#include <GL/glx.h>
#include <ev.h> #include <ev.h>
@ -33,14 +38,11 @@
#include "x.h" #include "x.h"
#include "config.h" #include "config.h"
#include "diagnostic.h" #include "diagnostic.h"
#include "string_utils.h"
#include "render.h" #include "render.h"
#include "utils.h" #include "utils.h"
#include "region.h" #include "region.h"
#include "types.h" #include "types.h"
#include "c2.h" #include "c2.h"
#include "kernel.h"
#include "vsync.h"
#include "log.h" #include "log.h"
#ifdef CONFIG_DBUS #ifdef CONFIG_DBUS
#include "dbus.h" #include "dbus.h"

View File

@ -2,33 +2,16 @@
// Copyright (c) // Copyright (c)
// Throw everything in here. // Throw everything in here.
// !!! DON'T !!!
// === Includes === // === Includes ===
#include <math.h> #include <stdlib.h>
#include <sys/select.h> #include <stdbool.h>
#include <limits.h>
#include <unistd.h>
#include <getopt.h>
#include <locale.h> #include <locale.h>
#include <signal.h> #include <xcb/xproto.h>
#ifdef CONFIG_VSYNC_DRM
#include <fcntl.h>
// We references some definitions in drm.h, which could also be found in
// /usr/src/linux/include/drm/drm.h, but that path is probably even less
// reliable than libdrm
#include <drm.h>
#include <sys/ioctl.h>
#include <errno.h>
#endif
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <pixman.h>
#ifdef CONFIG_OPENGL
#include "opengl.h" // XXX clean up
#endif
#include "common.h" #include "common.h"
#include "win.h" #include "win.h"
#include "x.h" #include "x.h"
@ -39,6 +22,7 @@
#include "types.h" #include "types.h"
#include "utils.h" #include "utils.h"
#include "render.h" #include "render.h"
#include "config.h"
// == Functions == // == Functions ==
// TODO move static inline functions that are only used in compton.c, into // TODO move static inline functions that are only used in compton.c, into

View File

@ -14,14 +14,15 @@ module kernel {
header "kernel.h" header "kernel.h"
} }
module utils { module utils {
// Has macros expands to calloc/malloc
header "utils.h" header "utils.h"
export libc.stdlib
} }
module region { module region {
header "region.h" header "region.h"
} }
module compton { module compton {
header "compton.h" header "compton.h"
exclude header "/usr/include/X11/Xlib.h"
} }
module types { module types {
header "types.h" header "types.h"
@ -43,7 +44,6 @@ module diagnostic {
} }
module win { module win {
header "win.h" header "win.h"
exclude header "/usr/include/GL/glx.h"
} }
module log { module log {
header "log.h" header "log.h"
@ -56,8 +56,6 @@ module vsync {
} }
module common { module common {
header "common.h" header "common.h"
exclude header "/usr/include/X11/Xlib.h"
exclude header "/usr/include/GL/glx.h"
} }
module config { module config {
header "config.h" header "config.h"
@ -78,7 +76,128 @@ module backend {
header "backend/backend_common.h" header "backend/backend_common.h"
} }
} }
module xcb [system] {
module xcb {
header "/usr/include/xcb/xcb.h"
export *
}
module randr {
header "/usr/include/xcb/randr.h"
export *
}
module render {
header "/usr/include/xcb/render.h"
export *
}
module sync {
header "/usr/include/xcb/sync.h"
export *
}
module composite {
header "/usr/include/xcb/composite.h"
export *
}
module xfixes {
header "/usr/include/xcb/xfixes.h"
export *
}
module damage {
header "/usr/include/xcb/damage.h"
export *
}
module xproto {
header "/usr/include/xcb/xproto.h"
export *
}
module present {
header "/usr/include/xcb/present.h"
}
module util {
module render {
header "/usr/include/xcb/xcb_renderutil.h"
export *
}
}
}
module X11 [system] {
module Xlib { module Xlib {
header "/usr/include/X11/Xlib.h" header "/usr/include/X11/Xlib.h"
export * export *
} }
module Xutil {
header "/usr/include/X11/Xutil.h"
export *
}
}
module GL [system] {
module glx {
header "/usr/include/GL/glx.h"
export *
}
module gl {
header "/usr/include/GL/gl.h"
export *
}
}
module libc [system] {
export *
module assert {
export *
textual header "/usr/include/assert.h"
}
module string {
export *
header "/usr/include/string.h"
}
module ctype {
export *
header "/usr/include/ctype.h"
}
module errno {
export *
header "/usr/include/errno.h"
}
module fenv {
export *
header "/usr/include/fenv.h"
}
module inttypes {
export *
header "/usr/include/inttypes.h"
}
module math {
export *
header "/usr/include/math.h"
}
module setjmp {
export *
header "/usr/include/setjmp.h"
}
module stdio {
export *
header "/usr/include/stdio.h"
}
module stdlib [system] {
export *
header "/usr/include/stdlib.h"
}
}
// glib specific header. In it's own module because it
// doesn't exist on some systems with unpatched glib 2.26+
module "xlocale.h" [system] {
export *
header "/usr/include/xlocale.h"
}
// System header that we have difficult with merging.
module "sys_types.h" [system] {
export *
header "/usr/include/sys/types.h"
}
module "signal.h" [system] {
export *
header "/usr/include/signal.h"
}

View File

@ -2,8 +2,12 @@
// Copyright (c) 2011-2013, Christopher Jeffrey // Copyright (c) 2011-2013, Christopher Jeffrey
// Copyright (c) 2013 Richard Grenville <pyxlcy@gmail.com> // Copyright (c) 2013 Richard Grenville <pyxlcy@gmail.com>
#include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <xcb/render.h> // for xcb_render_fixed_t, XXX
#include "compiler.h" #include "compiler.h"
#include "common.h" #include "common.h"

View File

@ -11,6 +11,8 @@
#include <stdbool.h> #include <stdbool.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <xcb/xcb.h>
#include <xcb/render.h> // for xcb_render_fixed_t, XXX
#include <xcb/xfixes.h> #include <xcb/xfixes.h>
#ifdef CONFIG_LIBCONFIG #ifdef CONFIG_LIBCONFIG

View File

@ -4,6 +4,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <libgen.h> #include <libgen.h>
#include <libconfig.h> #include <libconfig.h>

View File

@ -9,11 +9,14 @@
* *
*/ */
#include <string.h>
#include <stdlib.h>
#include <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <stdio.h>
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"

View File

@ -1,6 +1,9 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com> // Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com>
#include <stdio.h>
#include <xcb/xcb.h>
#include "diagnostic.h" #include "diagnostic.h"
#include "config.h" #include "config.h"
#include "common.h" #include "common.h"

View File

@ -2,6 +2,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <time.h> #include <time.h>

View File

@ -9,7 +9,12 @@
* *
*/ */
#include <string.h>
#include <stdlib.h>
#include <GL/glx.h> #include <GL/glx.h>
#include <xcb/xcb.h>
#include <xcb/render.h>
#include <stdio.h>
#include "compiler.h" #include "compiler.h"
#include "string_utils.h" #include "string_utils.h"

View File

@ -18,8 +18,12 @@
#include "win.h" #include "win.h"
#include "log.h" #include "log.h"
#include <xcb/xcb.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h> #include <ctype.h>
#include <locale.h> #include <locale.h>
#include <GL/glx.h>
/// @brief Wrapper of a GLX FBConfig. /// @brief Wrapper of a GLX FBConfig.
typedef struct glx_fbconfig { typedef struct glx_fbconfig {

View File

@ -4,14 +4,18 @@
#include <getopt.h> #include <getopt.h>
#include <locale.h> #include <locale.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include <xcb/render.h> // for xcb_render_fixed_t, XXX
#include "common.h" #include "common.h"
#include "config.h"
#include "log.h" #include "log.h"
#include "options.h"
#include "utils.h" #include "utils.h"
#include "win.h" #include "win.h"
#include "config.h"
#include "options.h"
#pragma GCC diagnostic error "-Wunused-parameter" #pragma GCC diagnostic error "-Wunused-parameter"
@ -466,8 +470,7 @@ static const struct option longopts[] = {
/// Get config options that are needed to parse the rest of the options /// Get config options that are needed to parse the rest of the options
/// Return true if we should quit /// Return true if we should quit
bool get_early_config(int argc, char *const *argv, char **config_file, bool *all_xerrors, bool get_early_config(int argc, char *const *argv, char **config_file, bool *all_xerrors, int *exit_code) {
int *exit_code) {
int o = 0, longopt_idx = -1; int o = 0, longopt_idx = -1;
// Pre-parse the commandline arguments to check for --config and invalid // Pre-parse the commandline arguments to check for --config and invalid
@ -839,8 +842,7 @@ void get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
DOUBLE_TO_XFIXED(1), DOUBLE_TO_XFIXED(1),
DOUBLE_TO_XFIXED(1), DOUBLE_TO_XFIXED(1),
}; };
opt->blur_kerns[0] = opt->blur_kerns[0] = ccalloc(ARR_SIZE(convolution_blur), xcb_render_fixed_t);
ccalloc(ARR_SIZE(convolution_blur), xcb_render_fixed_t);
memcpy(opt->blur_kerns[0], convolution_blur, sizeof(convolution_blur)); memcpy(opt->blur_kerns[0], convolution_blur, sizeof(convolution_blur));
} }

View File

@ -2,6 +2,7 @@
// Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com> // Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com>
#pragma once #pragma once
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <stdlib.h>
#include <pixman.h> #include <pixman.h>
#include <stdio.h> #include <stdio.h>

View File

@ -1,12 +1,19 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com> // Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
#include <stdlib.h>
#include <string.h>
#include <xcb/xcb_image.h> #include <xcb/xcb_image.h>
#include <xcb/composite.h>
#include <xcb/sync.h>
#include <xcb/render.h>
#include <xcb/xcb_renderutil.h>
#include "common.h" #include "common.h"
#include "options.h" #include "options.h"
#ifdef CONFIG_OPENGL #ifdef CONFIG_OPENGL
#include <GL/glx.h>
#include "opengl.h" #include "opengl.h"
#endif #endif

View File

@ -2,6 +2,7 @@
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com> // Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
#pragma once #pragma once
#include <xcb/xcb.h>
#include <xcb/render.h> #include <xcb/render.h>
#include <stdbool.h> #include <stdbool.h>
#include "region.h" #include "region.h"

View File

@ -1,4 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <sys/uio.h> #include <sys/uio.h>
#include "compiler.h" #include "compiler.h"

View File

@ -3,6 +3,8 @@
/// Function pointers to init VSync modes. /// Function pointers to init VSync modes.
#include <GL/glx.h>
#include "common.h" #include "common.h"
#include "log.h" #include "log.h"

View File

@ -3,11 +3,15 @@
// Copyright (c) 2013 Richard Grenville <pyxlcy@gmail.com> // Copyright (c) 2013 Richard Grenville <pyxlcy@gmail.com>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <xcb/xcb.h>
#include <xcb/render.h> #include <xcb/render.h>
#include <xcb/damage.h> #include <xcb/damage.h>
#include <xcb/xcb_renderutil.h> #include <xcb/xcb_renderutil.h>
#include <stdbool.h> #include <stdbool.h>
#include <math.h> #include <math.h>
#include <string.h>
#include <stdlib.h>
#include "compiler.h" #include "compiler.h"
#include "common.h" #include "common.h"

View File

@ -3,11 +3,13 @@
// Copyright (c) 2013 Richard Grenville <pyxlcy@gmail.com> // Copyright (c) 2013 Richard Grenville <pyxlcy@gmail.com>
#pragma once #pragma once
#include <stdbool.h> #include <stdbool.h>
#include <xcb/xcb.h>
#include <xcb/render.h>
#include <xcb/damage.h> #include <xcb/damage.h>
// FIXME shouldn't need this // FIXME shouldn't need this
#ifdef CONFIG_OPENGL #ifdef CONFIG_OPENGL
#include <GL/glx.h> #include <GL/gl.h>
#endif #endif
#include "x.h" #include "x.h"

View File

@ -1,12 +1,18 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com> // Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com>
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <xcb/xcb.h>
#include <xcb/xcb_renderutil.h> #include <xcb/xcb_renderutil.h>
#include <xcb/xfixes.h> #include <xcb/xfixes.h>
#include <xcb/sync.h> #include <xcb/sync.h>
#include <xcb/composite.h>
#include <xcb/damage.h>
#include <xcb/render.h>
#include <pixman.h> #include <pixman.h>
#include <GL/glx.h>
#include "utils.h" #include "utils.h"
#include "region.h" #include "region.h"