aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fake-quartz-cg.c13
-rw-r--r--fake-quartz-cg.h24
-rw-r--r--fake-w32-gdi.c20
-rw-r--r--fake-w32-gdi.h24
-rw-r--r--libgamma_dummy_crtc_destroy.c1
-rw-r--r--libgamma_dummy_crtc_get_gamma_ramps16.c1
-rw-r--r--libgamma_dummy_crtc_get_gamma_ramps32.c1
-rw-r--r--libgamma_dummy_crtc_get_gamma_ramps64.c1
-rw-r--r--libgamma_dummy_crtc_get_gamma_ramps8.c1
-rw-r--r--libgamma_dummy_crtc_get_gamma_rampsd.c1
-rw-r--r--libgamma_dummy_crtc_get_gamma_rampsf.c1
-rw-r--r--libgamma_dummy_crtc_initialise.c1
-rw-r--r--libgamma_dummy_crtc_restore.c1
-rw-r--r--libgamma_dummy_crtc_set_gamma_ramps16.c1
-rw-r--r--libgamma_dummy_crtc_set_gamma_ramps32.c1
-rw-r--r--libgamma_dummy_crtc_set_gamma_ramps64.c1
-rw-r--r--libgamma_dummy_crtc_set_gamma_ramps8.c1
-rw-r--r--libgamma_dummy_crtc_set_gamma_rampsd.c1
-rw-r--r--libgamma_dummy_crtc_set_gamma_rampsf.c1
-rw-r--r--libgamma_dummy_get_crtc_information.c1
-rw-r--r--libgamma_dummy_internal_configurations.c1
-rw-r--r--libgamma_dummy_internal_crtc_restore_forced.c1
-rw-r--r--libgamma_dummy_method_capabilities.c1
-rw-r--r--libgamma_dummy_partition_destroy.c1
-rw-r--r--libgamma_dummy_partition_initialise.c1
-rw-r--r--libgamma_dummy_partition_restore.c1
-rw-r--r--libgamma_dummy_site_destroy.c1
-rw-r--r--libgamma_dummy_site_initialise.c1
-rw-r--r--libgamma_dummy_site_restore.c1
-rw-r--r--libgamma_linux_drm_crtc_destroy.c1
-rw-r--r--libgamma_linux_drm_crtc_get_gamma_ramps16.c1
-rw-r--r--libgamma_linux_drm_crtc_initialise.c1
-rw-r--r--libgamma_linux_drm_crtc_restore.c1
-rw-r--r--libgamma_linux_drm_crtc_set_gamma_ramps16.c1
-rw-r--r--libgamma_linux_drm_get_crtc_information.c1
-rw-r--r--libgamma_linux_drm_internal_release_connectors_and_encoders.c1
-rw-r--r--libgamma_linux_drm_method_capabilities.c1
-rw-r--r--libgamma_linux_drm_partition_destroy.c1
-rw-r--r--libgamma_linux_drm_partition_initialise.c1
-rw-r--r--libgamma_linux_drm_partition_restore.c1
-rw-r--r--libgamma_linux_drm_site_destroy.c1
-rw-r--r--libgamma_linux_drm_site_initialise.c1
-rw-r--r--libgamma_linux_drm_site_restore.c1
-rw-r--r--libgamma_quartz_cg_crtc_destroy.c1
-rw-r--r--libgamma_quartz_cg_crtc_get_gamma_rampsf.c1
-rw-r--r--libgamma_quartz_cg_crtc_initialise.c1
-rw-r--r--libgamma_quartz_cg_crtc_restore.c1
-rw-r--r--libgamma_quartz_cg_crtc_set_gamma_rampsf.c1
-rw-r--r--libgamma_quartz_cg_get_crtc_information.c1
-rw-r--r--libgamma_quartz_cg_method_capabilities.c1
-rw-r--r--libgamma_quartz_cg_partition_destroy.c1
-rw-r--r--libgamma_quartz_cg_partition_initialise.c3
-rw-r--r--libgamma_quartz_cg_partition_restore.c1
-rw-r--r--libgamma_quartz_cg_site_destroy.c1
-rw-r--r--libgamma_quartz_cg_site_initialise.c1
-rw-r--r--libgamma_quartz_cg_site_restore.c1
-rw-r--r--libgamma_w32_gdi_crtc_destroy.c1
-rw-r--r--libgamma_w32_gdi_crtc_get_gamma_ramps16.c1
-rw-r--r--libgamma_w32_gdi_crtc_initialise.c1
-rw-r--r--libgamma_w32_gdi_crtc_restore.c1
-rw-r--r--libgamma_w32_gdi_crtc_set_gamma_ramps16.c1
-rw-r--r--libgamma_w32_gdi_get_crtc_information.c1
-rw-r--r--libgamma_w32_gdi_method_capabilities.c1
-rw-r--r--libgamma_w32_gdi_partition_destroy.c1
-rw-r--r--libgamma_w32_gdi_partition_initialise.c1
-rw-r--r--libgamma_w32_gdi_partition_restore.c1
-rw-r--r--libgamma_w32_gdi_site_destroy.c1
-rw-r--r--libgamma_w32_gdi_site_initialise.c1
-rw-r--r--libgamma_w32_gdi_site_restore.c1
-rw-r--r--libgamma_x_vidmode_crtc_destroy.c1
-rw-r--r--libgamma_x_vidmode_crtc_get_gamma_ramps16.c1
-rw-r--r--libgamma_x_vidmode_crtc_initialise.c1
-rw-r--r--libgamma_x_vidmode_crtc_restore.c1
-rw-r--r--libgamma_x_vidmode_crtc_set_gamma_ramps16.c1
-rw-r--r--libgamma_x_vidmode_get_crtc_information.c1
-rw-r--r--libgamma_x_vidmode_method_capabilities.c1
-rw-r--r--libgamma_x_vidmode_partition_destroy.c1
-rw-r--r--libgamma_x_vidmode_partition_initialise.c1
-rw-r--r--libgamma_x_vidmode_partition_restore.c1
-rw-r--r--libgamma_x_vidmode_site_destroy.c1
-rw-r--r--libgamma_x_vidmode_site_initialise.c1
-rw-r--r--libgamma_x_vidmode_site_restore.c1
-rw-r--r--method-dummy.h4
-rw-r--r--method-linux-drm.h9
-rw-r--r--method-quartz-cg.h12
-rw-r--r--method-w32-gdi.h22
-rw-r--r--method-x-randr.h13
-rw-r--r--method-x-vidmode.h6
-rw-r--r--mk/method-quartz-cg=fake.mk7
-rw-r--r--mk/method-quartz-cg=yes.mk3
-rw-r--r--mk/method-w32-gdi=fake.mk7
-rw-r--r--mk/method-w32-gdi=yes.mk3
92 files changed, 147 insertions, 100 deletions
diff --git a/fake-quartz-cg.c b/fake-quartz-cg.c
index 75f1fb2..34d3995 100644
--- a/fake-quartz-cg.c
+++ b/fake-quartz-cg.c
@@ -1,7 +1,6 @@
/* See LICENSE file for copyright and license details. */
-#ifndef FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-# error Compiling fake-quartz-cg.c without FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-#endif
+#define IN_LIBGAMMA_QUARTZ_CG
+#include "common.h"
/* This file very sloppily translates Mac OS X Quartz calls to X RandR calls.
* It should by no means be used, without additional modification, as a
@@ -10,12 +9,6 @@
* a GNU/Linux system under X. */
-#include "fake-quartz-cg.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#ifndef HAVE_LIBGAMMA_METHOD_X_RANDR
/* Use dummy translation */
@@ -150,7 +143,6 @@ close_fake_quartz(void)
#include <xcb/randr.h>
-
/**
* Connection to the X RandR display
*/
@@ -444,4 +436,5 @@ void close_fake_quartz_cg(void)
original_ramps = NULL;
}
+
#endif
diff --git a/fake-quartz-cg.h b/fake-quartz-cg.h
index 361a73c..198d609 100644
--- a/fake-quartz-cg.h
+++ b/fake-quartz-cg.h
@@ -1,15 +1,5 @@
/* See LICENSE file for copyright and license details. */
-#ifndef LIBGAMMA_FAKE_QUARTZ_CG_H
-#define LIBGAMMA_FAKE_QUARTZ_CG_H
-
-#ifndef FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-# error Including fake-quartz-cg.h without FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-#endif
-
-
-#ifndef __GNUC__
-# define __attribute__(x)
-#endif
+#ifdef IN_LIBGAMMA_QUARTZ_CG
/* This header file contains some capabilities of
@@ -24,9 +14,6 @@
* https://developer.apple.com/library/mac/documentation/CoreGraphics/Reference/CoreGraphicsConstantsRef/Reference/reference.html#//apple_ref/c/tdef/CGError */
-#include <stdint.h>
-
-
/**
* Numerical `typedef` for errors that occur in CoreGraphics calls
*/
@@ -48,6 +35,7 @@ typedef float CGGammaValue;
typedef uint32_t CGDirectDisplayID;
+
/**
* Get a list of all online displays on the system
*
@@ -97,7 +85,8 @@ void CGDisplayRestoreColorSyncSettings(void);
* @param display The ID of the display
* @return The number of stops in the gamma ramps
*/
-uint32_t CGDisplayGammaTableCapacity(CGDirectDisplayID) __attribute__((const));
+LIBGAMMA_GCC_ONLY__(__attribute__((__const__)))
+uint32_t CGDisplayGammaTableCapacity(CGDirectDisplayID);
/* The follow part most only be used when this module is used,
@@ -112,9 +101,4 @@ uint32_t CGDisplayGammaTableCapacity(CGDirectDisplayID) __attribute__((const));
void close_fake_quartz_cg(void);
-
-#ifndef __GNUC__
-# undef __attribute__
-#endif
-
#endif
diff --git a/fake-w32-gdi.c b/fake-w32-gdi.c
index 68847ca..bee0e93 100644
--- a/fake-w32-gdi.c
+++ b/fake-w32-gdi.c
@@ -1,7 +1,6 @@
/* See LICENSE file for copyright and license details. */
-#ifndef HAVE_LIBGAMMA_METHOD_W32_GDI
-# error Compiling fake-w32-gdi.c without FAKE_LIBGAMMA_METHOD_W32_GDI
-#endif
+#define IN_LIBGAMMA_W32_GDI
+#include "common.h"
/* This file very sloppily translates Windows GDI calls to X RandR calls.
* It should by no means be used, without additional modification, as a
@@ -10,18 +9,11 @@
* a GNU/Linux system under X. */
-#include "fake-w32-gdi.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#ifndef HAVE_LIBGAMMA_METHOD_X_RANDR
/* Use dummy translation */
-
/**
* Get the device context for a window or the entire screen
*
@@ -56,7 +48,6 @@ ReleaseDC(HWND hWnd, HDC hDC)
}
-
/**
* Get information (capabilities) for a device context
*
@@ -113,7 +104,6 @@ GetDeviceGammaRamp(HDC hDC, LPVOID restrict lpRamp)
}
-
/**
* Get the context for a device
*
@@ -262,7 +252,6 @@ ReleaseDC(HWND hWnd, HDC hDC)
}
-
/**
* Get information (capabilities) for a device context
*
@@ -306,7 +295,7 @@ SetDeviceGammaRamp(HDC hDC, LPVOID restrict lpRamp)
xcb_randr_set_crtc_gamma_checked(connection, *(xcb_randr_crtc_t *)hDC, GAMMA_RAMP_SIZE,
&((uint16_t *)lpRamp)[0 * GAMMA_RAMP_SIZE],
&((uint16_t *)lpRamp)[1 * GAMMA_RAMP_SIZE],
- &((uint16_t *)lpRamp)[2 * GAMMA_RAMP_SIZE)];
+ &((uint16_t *)lpRamp)[2 * GAMMA_RAMP_SIZE]);
xcb_generic_error_t *error = xcb_request_check(connection, gamma_cookie);
return !error ? TRUE : FALSE;
}
@@ -350,7 +339,6 @@ GetDeviceGammaRamp(HDC hDC, LPVOID restrict lpRamp)
}
-
/**
* Get the context for a device
*
@@ -469,7 +457,7 @@ EnumDisplayDevices(LPCTSTR restrict lpDevice, DWORD iDevNum, PDISPLAY_DEVICE res
return FALSE;
}
/* Store name for the CRTC */
- sprintf(lpDisplayDevice->DeviceName, "%i", iDevNum);
+ sprintf(lpDisplayDevice->DeviceName, "%lu", (unsigned long int)iDevNum);
/* The connector that the CRTC belongs to is enabled */
lpDisplayDevice->StateFlags = DISPLAY_DEVICE_ACTIVE;
return TRUE;
diff --git a/fake-w32-gdi.h b/fake-w32-gdi.h
index bcc2fa9..afbbc4b 100644
--- a/fake-w32-gdi.h
+++ b/fake-w32-gdi.h
@@ -1,17 +1,5 @@
/* See LICENSE file for copyright and license details. */
-#ifndef LIBGAMMA_FAKE_W32_GDI_H
-#define LIBGAMMA_FAKE_W32_GDI_H
-
-#ifndef FAKE_LIBGAMMA_METHOD_W32_GDI
-# error Including fake-w32-gdi.h without FAKE_LIBGAMMA_METHOD_W32_GDI
-#endif
-
-
-#ifndef __GNUC__
-# define __attribute__(x)
-#endif
-
-#include <stdint.h>
+#ifdef IN_LIBGAMMA_W32_GDI
/**
@@ -125,7 +113,8 @@ int ReleaseDC(HWND, HDC);
* if `nIndex` is `COLORMGMTCAPS`
* @see http://msdn.microsoft.com/en-us/library/windows/desktop/dd144877(v=vs.85).aspx
*/
-int GetDeviceCaps(HDC, int) __attribute__((const));
+LIBGAMMA_GCC_ONLY__(__attribute__((__const__)))
+int GetDeviceCaps(HDC, int);
/**
* Colour management capabilities
@@ -237,12 +226,7 @@ typedef DISPLAY_DEVICE *PDISPLAY_DEVICE;
* is greater than the largest device index on the system
* @see http://msdn.microsoft.com/en-us/library/windows/desktop/dd162609(v=vs.85).aspx
*/
-BOOL EnumDisplayDevices(LPCTSTR restrict, DWORD, PDISPLAY_DEVICE restrict, DWORD)
-
+BOOL EnumDisplayDevices(LPCTSTR restrict, DWORD, PDISPLAY_DEVICE restrict, DWORD);
-#ifndef __GNUC__
-# undef __attribute__
-#endif
-
#endif
diff --git a/libgamma_dummy_crtc_destroy.c b/libgamma_dummy_crtc_destroy.c
index 7464dd4..b79fb98 100644
--- a/libgamma_dummy_crtc_destroy.c
+++ b/libgamma_dummy_crtc_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_get_gamma_ramps16.c b/libgamma_dummy_crtc_get_gamma_ramps16.c
index 7f81225..9acda3c 100644
--- a/libgamma_dummy_crtc_get_gamma_ramps16.c
+++ b/libgamma_dummy_crtc_get_gamma_ramps16.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_get_gamma_ramps32.c b/libgamma_dummy_crtc_get_gamma_ramps32.c
index ba3dd92..c1a0b62 100644
--- a/libgamma_dummy_crtc_get_gamma_ramps32.c
+++ b/libgamma_dummy_crtc_get_gamma_ramps32.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_get_gamma_ramps64.c b/libgamma_dummy_crtc_get_gamma_ramps64.c
index 9421b32..3ec4fed 100644
--- a/libgamma_dummy_crtc_get_gamma_ramps64.c
+++ b/libgamma_dummy_crtc_get_gamma_ramps64.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_get_gamma_ramps8.c b/libgamma_dummy_crtc_get_gamma_ramps8.c
index 272c0f0..42a6616 100644
--- a/libgamma_dummy_crtc_get_gamma_ramps8.c
+++ b/libgamma_dummy_crtc_get_gamma_ramps8.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_get_gamma_rampsd.c b/libgamma_dummy_crtc_get_gamma_rampsd.c
index 05d3e98..70939ca 100644
--- a/libgamma_dummy_crtc_get_gamma_rampsd.c
+++ b/libgamma_dummy_crtc_get_gamma_rampsd.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_get_gamma_rampsf.c b/libgamma_dummy_crtc_get_gamma_rampsf.c
index 2d83235..bf89228 100644
--- a/libgamma_dummy_crtc_get_gamma_rampsf.c
+++ b/libgamma_dummy_crtc_get_gamma_rampsf.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_initialise.c b/libgamma_dummy_crtc_initialise.c
index 1ae9161..49a11f5 100644
--- a/libgamma_dummy_crtc_initialise.c
+++ b/libgamma_dummy_crtc_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_restore.c b/libgamma_dummy_crtc_restore.c
index 10a5b56..d2a50ce 100644
--- a/libgamma_dummy_crtc_restore.c
+++ b/libgamma_dummy_crtc_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_set_gamma_ramps16.c b/libgamma_dummy_crtc_set_gamma_ramps16.c
index 1239b3a..c386ccb 100644
--- a/libgamma_dummy_crtc_set_gamma_ramps16.c
+++ b/libgamma_dummy_crtc_set_gamma_ramps16.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_set_gamma_ramps32.c b/libgamma_dummy_crtc_set_gamma_ramps32.c
index c84880e..e178868 100644
--- a/libgamma_dummy_crtc_set_gamma_ramps32.c
+++ b/libgamma_dummy_crtc_set_gamma_ramps32.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_set_gamma_ramps64.c b/libgamma_dummy_crtc_set_gamma_ramps64.c
index 76c9f3b..0660b55 100644
--- a/libgamma_dummy_crtc_set_gamma_ramps64.c
+++ b/libgamma_dummy_crtc_set_gamma_ramps64.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_set_gamma_ramps8.c b/libgamma_dummy_crtc_set_gamma_ramps8.c
index 158bf50..6f4f7de 100644
--- a/libgamma_dummy_crtc_set_gamma_ramps8.c
+++ b/libgamma_dummy_crtc_set_gamma_ramps8.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_set_gamma_rampsd.c b/libgamma_dummy_crtc_set_gamma_rampsd.c
index 1d67e70..4583bbd 100644
--- a/libgamma_dummy_crtc_set_gamma_rampsd.c
+++ b/libgamma_dummy_crtc_set_gamma_rampsd.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_crtc_set_gamma_rampsf.c b/libgamma_dummy_crtc_set_gamma_rampsf.c
index e68b37d..1969b11 100644
--- a/libgamma_dummy_crtc_set_gamma_rampsf.c
+++ b/libgamma_dummy_crtc_set_gamma_rampsf.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_get_crtc_information.c b/libgamma_dummy_get_crtc_information.c
index 188afc9..2fb4ec6 100644
--- a/libgamma_dummy_get_crtc_information.c
+++ b/libgamma_dummy_get_crtc_information.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_internal_configurations.c b/libgamma_dummy_internal_configurations.c
index a5ee4a2..8aa3ae9 100644
--- a/libgamma_dummy_internal_configurations.c
+++ b/libgamma_dummy_internal_configurations.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_internal_crtc_restore_forced.c b/libgamma_dummy_internal_crtc_restore_forced.c
index c05f9bf..ab4cf50 100644
--- a/libgamma_dummy_internal_crtc_restore_forced.c
+++ b/libgamma_dummy_internal_crtc_restore_forced.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_method_capabilities.c b/libgamma_dummy_method_capabilities.c
index a59dbc8..f5b53fa 100644
--- a/libgamma_dummy_method_capabilities.c
+++ b/libgamma_dummy_method_capabilities.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_partition_destroy.c b/libgamma_dummy_partition_destroy.c
index 279cc61..946901e 100644
--- a/libgamma_dummy_partition_destroy.c
+++ b/libgamma_dummy_partition_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_partition_initialise.c b/libgamma_dummy_partition_initialise.c
index 093a4d2..c3147ba 100644
--- a/libgamma_dummy_partition_initialise.c
+++ b/libgamma_dummy_partition_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_partition_restore.c b/libgamma_dummy_partition_restore.c
index 90040c5..457086a 100644
--- a/libgamma_dummy_partition_restore.c
+++ b/libgamma_dummy_partition_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_site_destroy.c b/libgamma_dummy_site_destroy.c
index 7c707ba..f0d71ce 100644
--- a/libgamma_dummy_site_destroy.c
+++ b/libgamma_dummy_site_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_site_initialise.c b/libgamma_dummy_site_initialise.c
index 066f145..4154516 100644
--- a/libgamma_dummy_site_initialise.c
+++ b/libgamma_dummy_site_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_dummy_site_restore.c b/libgamma_dummy_site_restore.c
index 566a7f3..1e1d737 100644
--- a/libgamma_dummy_site_restore.c
+++ b/libgamma_dummy_site_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_DUMMY
#include "common.h"
diff --git a/libgamma_linux_drm_crtc_destroy.c b/libgamma_linux_drm_crtc_destroy.c
index 8fc62ee..0d0ce65 100644
--- a/libgamma_linux_drm_crtc_destroy.c
+++ b/libgamma_linux_drm_crtc_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_crtc_get_gamma_ramps16.c b/libgamma_linux_drm_crtc_get_gamma_ramps16.c
index 889b934..8242bae 100644
--- a/libgamma_linux_drm_crtc_get_gamma_ramps16.c
+++ b/libgamma_linux_drm_crtc_get_gamma_ramps16.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_crtc_initialise.c b/libgamma_linux_drm_crtc_initialise.c
index 022429b..233c34b 100644
--- a/libgamma_linux_drm_crtc_initialise.c
+++ b/libgamma_linux_drm_crtc_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_crtc_restore.c b/libgamma_linux_drm_crtc_restore.c
index a585e21..fae5446 100644
--- a/libgamma_linux_drm_crtc_restore.c
+++ b/libgamma_linux_drm_crtc_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_crtc_set_gamma_ramps16.c b/libgamma_linux_drm_crtc_set_gamma_ramps16.c
index 9691581..4147443 100644
--- a/libgamma_linux_drm_crtc_set_gamma_ramps16.c
+++ b/libgamma_linux_drm_crtc_set_gamma_ramps16.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_get_crtc_information.c b/libgamma_linux_drm_get_crtc_information.c
index f7ca7a8..2927702 100644
--- a/libgamma_linux_drm_get_crtc_information.c
+++ b/libgamma_linux_drm_get_crtc_information.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_internal_release_connectors_and_encoders.c b/libgamma_linux_drm_internal_release_connectors_and_encoders.c
index bede0ed..35cc6b9 100644
--- a/libgamma_linux_drm_internal_release_connectors_and_encoders.c
+++ b/libgamma_linux_drm_internal_release_connectors_and_encoders.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_method_capabilities.c b/libgamma_linux_drm_method_capabilities.c
index f6d0546..fd1679c 100644
--- a/libgamma_linux_drm_method_capabilities.c
+++ b/libgamma_linux_drm_method_capabilities.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_partition_destroy.c b/libgamma_linux_drm_partition_destroy.c
index 5fe8791..8b1e08c 100644
--- a/libgamma_linux_drm_partition_destroy.c
+++ b/libgamma_linux_drm_partition_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_partition_initialise.c b/libgamma_linux_drm_partition_initialise.c
index 02cfffc..997e4d2 100644
--- a/libgamma_linux_drm_partition_initialise.c
+++ b/libgamma_linux_drm_partition_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_partition_restore.c b/libgamma_linux_drm_partition_restore.c
index 9de56ef..561f5ff 100644
--- a/libgamma_linux_drm_partition_restore.c
+++ b/libgamma_linux_drm_partition_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_site_destroy.c b/libgamma_linux_drm_site_destroy.c
index 68a6b4c..2ef775a 100644
--- a/libgamma_linux_drm_site_destroy.c
+++ b/libgamma_linux_drm_site_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_site_initialise.c b/libgamma_linux_drm_site_initialise.c
index 81f6e12..e6ead83 100644
--- a/libgamma_linux_drm_site_initialise.c
+++ b/libgamma_linux_drm_site_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_linux_drm_site_restore.c b/libgamma_linux_drm_site_restore.c
index 0a5864f..b223051 100644
--- a/libgamma_linux_drm_site_restore.c
+++ b/libgamma_linux_drm_site_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_LINUX_DRM
#include "common.h"
diff --git a/libgamma_quartz_cg_crtc_destroy.c b/libgamma_quartz_cg_crtc_destroy.c
index e73bb65..9bf5ed9 100644
--- a/libgamma_quartz_cg_crtc_destroy.c
+++ b/libgamma_quartz_cg_crtc_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_crtc_get_gamma_rampsf.c b/libgamma_quartz_cg_crtc_get_gamma_rampsf.c
index a2e8056..bb12779 100644
--- a/libgamma_quartz_cg_crtc_get_gamma_rampsf.c
+++ b/libgamma_quartz_cg_crtc_get_gamma_rampsf.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_crtc_initialise.c b/libgamma_quartz_cg_crtc_initialise.c
index 988185f..f79db95 100644
--- a/libgamma_quartz_cg_crtc_initialise.c
+++ b/libgamma_quartz_cg_crtc_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_crtc_restore.c b/libgamma_quartz_cg_crtc_restore.c
index 78514eb..3958873 100644
--- a/libgamma_quartz_cg_crtc_restore.c
+++ b/libgamma_quartz_cg_crtc_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_crtc_set_gamma_rampsf.c b/libgamma_quartz_cg_crtc_set_gamma_rampsf.c
index 5cde1eb..7f53656 100644
--- a/libgamma_quartz_cg_crtc_set_gamma_rampsf.c
+++ b/libgamma_quartz_cg_crtc_set_gamma_rampsf.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_get_crtc_information.c b/libgamma_quartz_cg_get_crtc_information.c
index da4937e..185c3f5 100644
--- a/libgamma_quartz_cg_get_crtc_information.c
+++ b/libgamma_quartz_cg_get_crtc_information.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_method_capabilities.c b/libgamma_quartz_cg_method_capabilities.c
index 661fc0f..30a3a4d 100644
--- a/libgamma_quartz_cg_method_capabilities.c
+++ b/libgamma_quartz_cg_method_capabilities.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_partition_destroy.c b/libgamma_quartz_cg_partition_destroy.c
index 9aed872..0e6473c 100644
--- a/libgamma_quartz_cg_partition_destroy.c
+++ b/libgamma_quartz_cg_partition_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_partition_initialise.c b/libgamma_quartz_cg_partition_initialise.c
index 694ecbc..dbdec9e 100644
--- a/libgamma_quartz_cg_partition_initialise.c
+++ b/libgamma_quartz_cg_partition_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
@@ -41,7 +42,7 @@ libgamma_quartz_cg_partition_initialise(libgamma_partition_state_t *restrict thi
if (n < cap)
break;
/* Increase the number CRTC ID:s to ask for */
- if (cap > SIZE_MAX / 2) /* We could also test ~0, but it is still too many */
+ if (cap > UINT32_MAX / 2) /* We could also test ~0, but it is still too many */
return free(crtcs), LIBGAMMA_IMPOSSIBLE_AMOUNT;
cap <<= 1;
/* Grow the array of CRTC ID:s so that it can fit all we are asking for */
diff --git a/libgamma_quartz_cg_partition_restore.c b/libgamma_quartz_cg_partition_restore.c
index 094952b..6c85b41 100644
--- a/libgamma_quartz_cg_partition_restore.c
+++ b/libgamma_quartz_cg_partition_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_site_destroy.c b/libgamma_quartz_cg_site_destroy.c
index 9fd65d1..d127820 100644
--- a/libgamma_quartz_cg_site_destroy.c
+++ b/libgamma_quartz_cg_site_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_site_initialise.c b/libgamma_quartz_cg_site_initialise.c
index 962471d..e42155b 100644
--- a/libgamma_quartz_cg_site_initialise.c
+++ b/libgamma_quartz_cg_site_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_quartz_cg_site_restore.c b/libgamma_quartz_cg_site_restore.c
index 0accad5..101e8d6 100644
--- a/libgamma_quartz_cg_site_restore.c
+++ b/libgamma_quartz_cg_site_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_QUARTZ_CG
#include "common.h"
diff --git a/libgamma_w32_gdi_crtc_destroy.c b/libgamma_w32_gdi_crtc_destroy.c
index 0bbb8e9..c0f2dfe 100644
--- a/libgamma_w32_gdi_crtc_destroy.c
+++ b/libgamma_w32_gdi_crtc_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_crtc_get_gamma_ramps16.c b/libgamma_w32_gdi_crtc_get_gamma_ramps16.c
index 64218d7..6d62ded 100644
--- a/libgamma_w32_gdi_crtc_get_gamma_ramps16.c
+++ b/libgamma_w32_gdi_crtc_get_gamma_ramps16.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_crtc_initialise.c b/libgamma_w32_gdi_crtc_initialise.c
index 7bd2218..eafa61b 100644
--- a/libgamma_w32_gdi_crtc_initialise.c
+++ b/libgamma_w32_gdi_crtc_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_crtc_restore.c b/libgamma_w32_gdi_crtc_restore.c
index 85dceb6..54b28b5 100644
--- a/libgamma_w32_gdi_crtc_restore.c
+++ b/libgamma_w32_gdi_crtc_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_crtc_set_gamma_ramps16.c b/libgamma_w32_gdi_crtc_set_gamma_ramps16.c
index 10f7524..a9a7624 100644
--- a/libgamma_w32_gdi_crtc_set_gamma_ramps16.c
+++ b/libgamma_w32_gdi_crtc_set_gamma_ramps16.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_get_crtc_information.c b/libgamma_w32_gdi_get_crtc_information.c
index c3c2819..7ffb0e2 100644
--- a/libgamma_w32_gdi_get_crtc_information.c
+++ b/libgamma_w32_gdi_get_crtc_information.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_method_capabilities.c b/libgamma_w32_gdi_method_capabilities.c
index 18860c8..f6e5a23 100644
--- a/libgamma_w32_gdi_method_capabilities.c
+++ b/libgamma_w32_gdi_method_capabilities.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_partition_destroy.c b/libgamma_w32_gdi_partition_destroy.c
index e508083..95445d8 100644
--- a/libgamma_w32_gdi_partition_destroy.c
+++ b/libgamma_w32_gdi_partition_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_partition_initialise.c b/libgamma_w32_gdi_partition_initialise.c
index 81ab398..1220f8f 100644
--- a/libgamma_w32_gdi_partition_initialise.c
+++ b/libgamma_w32_gdi_partition_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_partition_restore.c b/libgamma_w32_gdi_partition_restore.c
index d2d5498..d11de5c 100644
--- a/libgamma_w32_gdi_partition_restore.c
+++ b/libgamma_w32_gdi_partition_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_site_destroy.c b/libgamma_w32_gdi_site_destroy.c
index 4b022d9..461958b 100644
--- a/libgamma_w32_gdi_site_destroy.c
+++ b/libgamma_w32_gdi_site_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_site_initialise.c b/libgamma_w32_gdi_site_initialise.c
index 7fa8fcc..423e958 100644
--- a/libgamma_w32_gdi_site_initialise.c
+++ b/libgamma_w32_gdi_site_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_w32_gdi_site_restore.c b/libgamma_w32_gdi_site_restore.c
index dd688f0..4cf963f 100644
--- a/libgamma_w32_gdi_site_restore.c
+++ b/libgamma_w32_gdi_site_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_W32_GDI
#include "common.h"
diff --git a/libgamma_x_vidmode_crtc_destroy.c b/libgamma_x_vidmode_crtc_destroy.c
index 4fe5d92..3c1facc 100644
--- a/libgamma_x_vidmode_crtc_destroy.c
+++ b/libgamma_x_vidmode_crtc_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_crtc_get_gamma_ramps16.c b/libgamma_x_vidmode_crtc_get_gamma_ramps16.c
index 993e126..ca52556 100644
--- a/libgamma_x_vidmode_crtc_get_gamma_ramps16.c
+++ b/libgamma_x_vidmode_crtc_get_gamma_ramps16.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_crtc_initialise.c b/libgamma_x_vidmode_crtc_initialise.c
index ca36a6d..8e4e59f 100644
--- a/libgamma_x_vidmode_crtc_initialise.c
+++ b/libgamma_x_vidmode_crtc_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_crtc_restore.c b/libgamma_x_vidmode_crtc_restore.c
index fb67351..22cec37 100644
--- a/libgamma_x_vidmode_crtc_restore.c
+++ b/libgamma_x_vidmode_crtc_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_crtc_set_gamma_ramps16.c b/libgamma_x_vidmode_crtc_set_gamma_ramps16.c
index 6ad18fc..c6d391d 100644
--- a/libgamma_x_vidmode_crtc_set_gamma_ramps16.c
+++ b/libgamma_x_vidmode_crtc_set_gamma_ramps16.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_get_crtc_information.c b/libgamma_x_vidmode_get_crtc_information.c
index 8462b1b..c3cc367 100644
--- a/libgamma_x_vidmode_get_crtc_information.c
+++ b/libgamma_x_vidmode_get_crtc_information.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_method_capabilities.c b/libgamma_x_vidmode_method_capabilities.c
index 5ef885d..c7893ba 100644
--- a/libgamma_x_vidmode_method_capabilities.c
+++ b/libgamma_x_vidmode_method_capabilities.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_partition_destroy.c b/libgamma_x_vidmode_partition_destroy.c
index 708d67f..57fcf62 100644
--- a/libgamma_x_vidmode_partition_destroy.c
+++ b/libgamma_x_vidmode_partition_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_partition_initialise.c b/libgamma_x_vidmode_partition_initialise.c
index 829e822..e22d380 100644
--- a/libgamma_x_vidmode_partition_initialise.c
+++ b/libgamma_x_vidmode_partition_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_partition_restore.c b/libgamma_x_vidmode_partition_restore.c
index 35e6719..0d04c71 100644
--- a/libgamma_x_vidmode_partition_restore.c
+++ b/libgamma_x_vidmode_partition_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_site_destroy.c b/libgamma_x_vidmode_site_destroy.c
index 378d336..a4a8bc2 100644
--- a/libgamma_x_vidmode_site_destroy.c
+++ b/libgamma_x_vidmode_site_destroy.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_site_initialise.c b/libgamma_x_vidmode_site_initialise.c
index fd4fa55..7d185ab 100644
--- a/libgamma_x_vidmode_site_initialise.c
+++ b/libgamma_x_vidmode_site_initialise.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/libgamma_x_vidmode_site_restore.c b/libgamma_x_vidmode_site_restore.c
index 77e9034..ce0d768 100644
--- a/libgamma_x_vidmode_site_restore.c
+++ b/libgamma_x_vidmode_site_restore.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#define IN_LIBGAMMA_X_VIDMODE
#include "common.h"
diff --git a/method-dummy.h b/method-dummy.h
index d6c5488..9fa1df6 100644
--- a/method-dummy.h
+++ b/method-dummy.h
@@ -2,6 +2,7 @@
#if !defined(LIBGAMMA_DUMMY_GET_RAMPS) && !defined(LIBGAMMA_DUMMY_SET_RAMPS)
+#ifdef IN_LIBGAMMA_DUMMY
/**
* Configuration set for the dummy adjustment method
*/
@@ -182,6 +183,7 @@ typedef struct libgamma_dummy_site {
* Configurations for the dummy adjustment method
*/
extern libgamma_dummy_configurations_t libgamma_dummy_internal_configurations;
+#endif
@@ -440,6 +442,7 @@ int libgamma_dummy_crtc_set_gamma_rampsd(libgamma_crtc_state_t *restrict, const
+#ifdef IN_LIBGAMMA_DUMMY
/**
* Restore the gamma ramps for a CRTC to the system settings for that CRTC
* and ignore the method's capabilities
@@ -450,6 +453,7 @@ int libgamma_dummy_crtc_set_gamma_rampsd(libgamma_crtc_state_t *restrict, const
*/
LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
int libgamma_dummy_internal_crtc_restore_forced(libgamma_dummy_crtc_t *restrict);
+#endif
#else
diff --git a/method-linux-drm.h b/method-linux-drm.h
index 50da38e..b30341d 100644
--- a/method-linux-drm.h
+++ b/method-linux-drm.h
@@ -1,8 +1,8 @@
/* See LICENSE file for copyright and license details. */
-#include <xf86drm.h>
-#include <xf86drmMode.h>
-
+#ifdef IN_LIBGAMMA_LINUX_DRM
+# include <xf86drm.h>
+# include <xf86drmMode.h>
/**
* Graphics card data for the Direct Rendering Manager adjustment method
@@ -29,6 +29,7 @@ typedef struct libgamma_drm_card_data {
drmModeEncoder **encoders;
} libgamma_drm_card_data_t;
+#endif
@@ -172,6 +173,7 @@ int libgamma_linux_drm_crtc_set_gamma_ramps16(libgamma_crtc_state_t *restrict, c
+#ifdef IN_LIBGAMMA_LINUX_DRM
/**
* Release all connectors and encoders
*
@@ -179,3 +181,4 @@ int libgamma_linux_drm_crtc_set_gamma_ramps16(libgamma_crtc_state_t *restrict, c
*/
LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__)))
void libgamma_linux_drm_internal_release_connectors_and_encoders(libgamma_drm_card_data_t *restrict);
+#endif
diff --git a/method-quartz-cg.h b/method-quartz-cg.h
index 83ee61a..96effa5 100644
--- a/method-quartz-cg.h
+++ b/method-quartz-cg.h
@@ -1,11 +1,11 @@
/* See LICENSE file for copyright and license details. */
-#ifdef FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
-# include "fake-quartz-cg.h"
-#else
-# include <ApplicationServices/ApplicationServices.h>
-# include <CoreGraphics/CGDirectDisplay.h>
-# define close_fake_quartz_cg() /* For compatibility with "fake-quartz-cg.h" */
+#ifdef IN_LIBGAMMA_QUARTZ_CG
+# ifndef FAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+# include <ApplicationServices/ApplicationServices.h>
+# include <CoreGraphics/CGDirectDisplay.h>
+# define close_fake_quartz_cg() /* For compatibility with "fake-quartz-cg.h" */
+# endif
#endif
diff --git a/method-w32-gdi.h b/method-w32-gdi.h
index d78af91..811c546 100644
--- a/method-w32-gdi.h
+++ b/method-w32-gdi.h
@@ -1,14 +1,13 @@
/* See LICENSE file for copyright and license details. */
-#ifndef WINVER
-# define WINVER 0x0500
-#endif
-#ifdef FAKE_LIBGAMMA_METHOD_W32_GDI
-# include "fake-w32-gdi.h"
-#else
-# include <windows.h>
-# include <wingdi.h>
-#endif
+#ifdef IN_LIBGAMMA_W32_GDI
+# ifndef WINVER
+# define WINVER 0x0500
+# endif
+# ifndef FAKE_LIBGAMMA_METHOD_W32_GDI
+# include <windows.h>
+# include <wingdi.h>
+# endif
/**
@@ -16,7 +15,8 @@
*
* @see http://msdn.microsoft.com/en-us/library/windows/desktop/dd372194(v=vs.85).aspx
*/
-#define W32_GDI_GAMMA_RAMP_SIZE 256
+# define W32_GDI_GAMMA_RAMP_SIZE 256
+#endif
@@ -41,7 +41,7 @@ void libgamma_w32_gdi_method_capabilities(libgamma_method_capabilities_t *restri
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
-LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__(1)))
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__(1))))
int libgamma_w32_gdi_site_initialise(libgamma_site_state_t *restrict, char *restrict);
/**
diff --git a/method-x-randr.h b/method-x-randr.h
index 81c5275..51dc0bf 100644
--- a/method-x-randr.h
+++ b/method-x-randr.h
@@ -1,18 +1,20 @@
/* See LICENSE file for copyright and license details. */
-#include <xcb/xcb.h>
-#include <xcb/randr.h>
+
+#ifdef IN_LIBGAMMA_X_RANDR
+# include <xcb/xcb.h>
+# include <xcb/randr.h>
/**
* The major version of RandR the library expects
*/
-#define RANDR_VERSION_MAJOR 1
+# define RANDR_VERSION_MAJOR 1
/**
* The minor version of RandR the library expects
*/
-#define RANDR_VERSION_MINOR 3
+# define RANDR_VERSION_MINOR 3
/**
@@ -48,6 +50,7 @@ typedef struct libgamma_x_randr_partition_data {
xcb_timestamp_t config_timestamp;
} libgamma_x_randr_partition_data_t;
+#endif
@@ -191,6 +194,7 @@ int libgamma_x_randr_crtc_set_gamma_ramps16(libgamma_crtc_state_t *restrict, con
+#ifdef IN_LIBGAMMA_X_RANDR
/**
* Translate an xcb error into a libgamma error
*
@@ -205,7 +209,6 @@ int libgamma_x_randr_internal_translate_error(int, int, int);
/* xcb violates the rule to never return struct:s */
-#ifdef IN_LIBGAMMA_X_RANDR
# ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Waggregate-return"
diff --git a/method-x-vidmode.h b/method-x-vidmode.h
index 3612ff1..8370e86 100644
--- a/method-x-vidmode.h
+++ b/method-x-vidmode.h
@@ -1,7 +1,9 @@
/* See LICENSE file for copyright and license details. */
-#include <X11/Xlib.h>
-#include <X11/extensions/xf86vmode.h>
+#ifdef IN_LIBGAMMA_X_VIDMODE
+# include <X11/Xlib.h>
+# include <X11/extensions/xf86vmode.h>
+#endif
/**
diff --git a/mk/method-quartz-cg=fake.mk b/mk/method-quartz-cg=fake.mk
index 496ac8a..0c55278 100644
--- a/mk/method-quartz-cg=fake.mk
+++ b/mk/method-quartz-cg=fake.mk
@@ -1,3 +1,6 @@
-HDR_QUARTZ_GC = method-quartz-cg.h
-PARAMS_QUARTZ_GC = LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS quartz_cg -1 rampsf
+include mk/method-quartz-cg=yes.mk
+HDR_QUARTZ_GC = fake-quartz-cg.h method-quartz-cg.h
+OBJ_FAKE_QUARTZ_GC = fake-quartz-cg.o
CPPFLAGS_QUARTZ_GC = -DHAVE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS -DFAKE_LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS
+CFLAGS_QUARTZ_GC =
+LDFLAGS_QUARTZ_GC =
diff --git a/mk/method-quartz-cg=yes.mk b/mk/method-quartz-cg=yes.mk
index cb079cf..540c23e 100644
--- a/mk/method-quartz-cg=yes.mk
+++ b/mk/method-quartz-cg=yes.mk
@@ -20,4 +20,5 @@ OBJ_QUARTZ_GC =\
libgamma_quartz_cg_crtc_restore.o\
libgamma_quartz_cg_get_crtc_information.o\
libgamma_quartz_cg_crtc_get_gamma_rampsf.o\
- libgamma_quartz_cg_crtc_set_gamma_rampsf.o
+ libgamma_quartz_cg_crtc_set_gamma_rampsf.o\
+ $(OBJ_FAKE_QUARTZ_GC)
diff --git a/mk/method-w32-gdi=fake.mk b/mk/method-w32-gdi=fake.mk
index fd068a8..256404e 100644
--- a/mk/method-w32-gdi=fake.mk
+++ b/mk/method-w32-gdi=fake.mk
@@ -1,3 +1,6 @@
-HDR_W32_GDI = method-w32-gdi.h
-PARAMS_W32_GDI = LIBGAMMA_METHOD_W32_GDI w32_gdi 16 ramps16
+include mk/method-w32-gdi=yes.mk
+HDR_W32_GDI = fake-w32-gdi.h method-w32-gdi.h
+OBJ_FAKE_W32_GDI = fake-w32-gdi.o
CPPFLAGS_W32_GDI = -DHAVE_LIBGAMMA_METHOD_W32_GDI -DFAKE_LIBGAMMA_METHOD_W32_GDI
+CFLAGS_W32_GDI =
+LDFLAGS_W32_GDI =
diff --git a/mk/method-w32-gdi=yes.mk b/mk/method-w32-gdi=yes.mk
index 3f62a2d..1f04c43 100644
--- a/mk/method-w32-gdi=yes.mk
+++ b/mk/method-w32-gdi=yes.mk
@@ -15,4 +15,5 @@ OBJ_W32_GDI =\
libgamma_w32_gdi_crtc_restore.o\
libgamma_w32_gdi_get_crtc_information.o\
libgamma_w32_gdi_crtc_get_gamma_ramps16.o\
- libgamma_w32_gdi_crtc_set_gamma_ramps16.o
+ libgamma_w32_gdi_crtc_set_gamma_ramps16.o\
+ $(OBJ_FAKE_W32_GDI)