1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 // The header <X11/X.h> defines "None" as a macro that expands to "0L". 8 // This is terrible because many enumerations have an enumerator named "None". 9 // To work around this, we undefine the macro "None", and define a replacement 10 // macro named "X11None". 11 // Include this header after including X11 headers, where necessary. 12 #ifdef None 13 #undef None 14 #define X11None 0L 15 // <X11/X.h> also defines "RevertToNone" as a macro that expands to "(int)None". 16 // Since we are undefining "None", that stops working. To keep it working, 17 // we undefine "RevertToNone" and redefine it in terms of "X11None". 18 #ifdef RevertToNone 19 #undef RevertToNone 20 #define RevertToNone (int)X11None 21 #endif 22 #endif 23