From 9cd661e746708a76761ff1fda361c6276ee71ab1 Mon Sep 17 00:00:00 2001 From: Andrew Wedgbury Date: Mon, 7 Apr 2014 12:40:35 +0100 Subject: Make sure config.h is included before any system headers There was an issue recently in screen-share.c where config.h was not being included, resulting in the wrong definition for off_t being used on 32 bit systems. I checked and I don't think this problem is happening elsewhere, but to help avoid this sort of problem in the future, I went through and made sure that config.h is included first whenever system headers are included. The config.h header should be included before any system headers, failing to do this can result in the wrong type sizes being defined on certain systems, e.g. off_t from sys/types.h Signed-off-by: Andrew Wedgbury --- clients/calibrator.c | 2 ++ clients/clickdot.c | 2 ++ clients/cliptest.c | 2 ++ clients/dnd.c | 2 ++ clients/eventdemo.c | 2 ++ clients/flower.c | 2 ++ clients/fullscreen.c | 2 ++ clients/image.c | 2 ++ clients/keyboard.c | 2 ++ clients/nested-client.c | 2 ++ clients/nested.c | 2 ++ clients/resizor.c | 2 ++ clients/scaler.c | 2 ++ clients/simple-egl.c | 2 ++ clients/smoke.c | 2 ++ clients/subsurfaces.c | 2 ++ clients/transformed.c | 2 ++ clients/window.h | 2 ++ clients/wscreensaver.h | 2 ++ shared/os-compatibility.h | 4 ++-- src/vaapi-recorder.c | 2 ++ tests/bad-buffer-test.c | 2 ++ tests/buffer-count-test.c | 2 ++ tests/button-test.c | 2 ++ tests/config-parser-test.c | 2 ++ tests/matrix-test.c | 2 ++ tests/setbacklight.c | 2 ++ tests/subsurface-test.c | 2 ++ tests/surface-global-test.c | 2 ++ tests/text-test.c | 2 ++ tests/vertex-clip-test.c | 3 +++ tests/weston-test-client-helper.h | 2 ++ tests/weston-test-runner.h | 2 ++ 33 files changed, 67 insertions(+), 2 deletions(-) diff --git a/clients/calibrator.c b/clients/calibrator.c index 783cdecc..1eb117f0 100644 --- a/clients/calibrator.c +++ b/clients/calibrator.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/clickdot.c b/clients/clickdot.c index c300fa54..e09cb142 100644 --- a/clients/clickdot.c +++ b/clients/clickdot.c @@ -22,6 +22,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/cliptest.c b/clients/cliptest.c index 89c3ca73..3cee343f 100644 --- a/clients/cliptest.c +++ b/clients/cliptest.c @@ -30,6 +30,8 @@ * surface transform disable key: r */ +#include "config.h" + #include #include #include diff --git a/clients/dnd.c b/clients/dnd.c index 00739c31..a463d6f6 100644 --- a/clients/dnd.c +++ b/clients/dnd.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/eventdemo.c b/clients/eventdemo.c index 029b1d8b..5ec68296 100644 --- a/clients/eventdemo.c +++ b/clients/eventdemo.c @@ -30,6 +30,8 @@ * \author Tim Wiederhake */ +#include "config.h" + #include #include diff --git a/clients/flower.c b/clients/flower.c index 389f8bee..87694450 100644 --- a/clients/flower.c +++ b/clients/flower.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/fullscreen.c b/clients/fullscreen.c index 7dc43744..fa8028a9 100644 --- a/clients/fullscreen.c +++ b/clients/fullscreen.c @@ -21,6 +21,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/image.c b/clients/image.c index 3a52c220..054979d9 100644 --- a/clients/image.c +++ b/clients/image.c @@ -21,6 +21,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/keyboard.c b/clients/keyboard.c index 6876cdec..11fe21d4 100644 --- a/clients/keyboard.c +++ b/clients/keyboard.c @@ -21,6 +21,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/nested-client.c b/clients/nested-client.c index 1161a992..7f237e66 100644 --- a/clients/nested-client.c +++ b/clients/nested-client.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/nested.c b/clients/nested.c index 3bdb9613..44389e40 100644 --- a/clients/nested.c +++ b/clients/nested.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/resizor.c b/clients/resizor.c index b5ea55f6..029042fd 100644 --- a/clients/resizor.c +++ b/clients/resizor.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/scaler.c b/clients/scaler.c index 2a43fcfa..f94e714b 100644 --- a/clients/scaler.c +++ b/clients/scaler.c @@ -21,6 +21,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 410e3ab7..0d4673b5 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/smoke.c b/clients/smoke.c index dd5f4bd4..5d976af1 100644 --- a/clients/smoke.c +++ b/clients/smoke.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/subsurfaces.c b/clients/subsurfaces.c index 45cc44b4..66a10f25 100644 --- a/clients/subsurfaces.c +++ b/clients/subsurfaces.c @@ -22,6 +22,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/transformed.c b/clients/transformed.c index dd246a08..4b1cb056 100644 --- a/clients/transformed.c +++ b/clients/transformed.c @@ -21,6 +21,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/clients/window.h b/clients/window.h index ae3af404..4e4ccc1d 100644 --- a/clients/window.h +++ b/clients/window.h @@ -23,6 +23,8 @@ #ifndef _WINDOW_H_ #define _WINDOW_H_ +#include "config.h" + #include #include #include diff --git a/clients/wscreensaver.h b/clients/wscreensaver.h index e2749d97..f85b94c6 100644 --- a/clients/wscreensaver.h +++ b/clients/wscreensaver.h @@ -23,6 +23,8 @@ #ifndef WSCREENSAVER_H #define WSCREENSAVER_H +#include "config.h" + #define MESA_EGL_NO_X11_HEADERS #include diff --git a/shared/os-compatibility.h b/shared/os-compatibility.h index 10dbb7dd..172bb7ed 100644 --- a/shared/os-compatibility.h +++ b/shared/os-compatibility.h @@ -23,10 +23,10 @@ #ifndef OS_COMPATIBILITY_H #define OS_COMPATIBILITY_H -#include - #include "config.h" +#include + #ifdef HAVE_EXECINFO_H #include #else diff --git a/src/vaapi-recorder.c b/src/vaapi-recorder.c index 41314071..0095a42d 100644 --- a/src/vaapi-recorder.c +++ b/src/vaapi-recorder.c @@ -43,6 +43,8 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/tests/bad-buffer-test.c b/tests/bad-buffer-test.c index 4f5f8109..6eae313e 100644 --- a/tests/bad-buffer-test.c +++ b/tests/bad-buffer-test.c @@ -21,6 +21,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include diff --git a/tests/buffer-count-test.c b/tests/buffer-count-test.c index dfc4673a..8b1dd5d1 100644 --- a/tests/buffer-count-test.c +++ b/tests/buffer-count-test.c @@ -20,6 +20,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include "weston-test-client-helper.h" diff --git a/tests/button-test.c b/tests/button-test.c index dc02fd44..d5ad8134 100644 --- a/tests/button-test.c +++ b/tests/button-test.c @@ -20,6 +20,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include "weston-test-client-helper.h" diff --git a/tests/config-parser-test.c b/tests/config-parser-test.c index 4b8fc7e7..4b255b7d 100644 --- a/tests/config-parser-test.c +++ b/tests/config-parser-test.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/tests/matrix-test.c b/tests/matrix-test.c index 5b0513f3..7b414c9a 100644 --- a/tests/matrix-test.c +++ b/tests/matrix-test.c @@ -20,6 +20,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/tests/setbacklight.c b/tests/setbacklight.c index 92bd4bf3..c8eba436 100644 --- a/tests/setbacklight.c +++ b/tests/setbacklight.c @@ -28,6 +28,8 @@ * program. */ +#include "config.h" + #include #include #include diff --git a/tests/subsurface-test.c b/tests/subsurface-test.c index 1c2641b6..0670e7f7 100644 --- a/tests/subsurface-test.c +++ b/tests/subsurface-test.c @@ -20,6 +20,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include "weston-test-client-helper.h" diff --git a/tests/surface-global-test.c b/tests/surface-global-test.c index b496635c..edc5d9f6 100644 --- a/tests/surface-global-test.c +++ b/tests/surface-global-test.c @@ -20,6 +20,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include "../src/compositor.h" diff --git a/tests/text-test.c b/tests/text-test.c index 1f10b1bb..c838a5d2 100644 --- a/tests/text-test.c +++ b/tests/text-test.c @@ -20,6 +20,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include #include diff --git a/tests/vertex-clip-test.c b/tests/vertex-clip-test.c index 6d44aa2a..1a09437e 100644 --- a/tests/vertex-clip-test.c +++ b/tests/vertex-clip-test.c @@ -19,6 +19,9 @@ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include "config.h" + #include #include #include diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h index 6670ab37..4bfc3fac 100644 --- a/tests/weston-test-client-helper.h +++ b/tests/weston-test-client-helper.h @@ -23,6 +23,8 @@ #ifndef _WESTON_TEST_CLIENT_HELPER_H_ #define _WESTON_TEST_CLIENT_HELPER_H_ +#include "config.h" + #include #include "weston-test-runner.h" #include "wayland-test-client-protocol.h" diff --git a/tests/weston-test-runner.h b/tests/weston-test-runner.h index 457cf31c..e1db0409 100644 --- a/tests/weston-test-runner.h +++ b/tests/weston-test-runner.h @@ -24,6 +24,8 @@ #ifndef _WESTON_TEST_RUNNER_H_ #define _WESTON_TEST_RUNNER_H_ +#include "config.h" + #include #ifdef NDEBUG -- cgit v1.2.3