• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Dawn Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef COMMON_XLIB_WITH_UNDEFS_H_
16 #define COMMON_XLIB_WITH_UNDEFS_H_
17 
18 #include "common/Platform.h"
19 
20 #if !defined(DAWN_PLATFORM_LINUX)
21 #    error "xlib_with_undefs.h included on non-Linux"
22 #endif
23 
24 // This header includes <X11/Xlib.h> but removes all the extra defines that conflict with
25 // identifiers in internal code. It should never be included in something that is part of the public
26 // interface.
27 #include <X11/Xlib.h>
28 
29 // Xlib-xcb.h technically includes Xlib.h but we separate the includes to make it more clear what
30 // the problem is if one of these two includes fail.
31 #include <X11/Xlib-xcb.h>
32 
33 #undef Success
34 #undef None
35 #undef Always
36 #undef Bool
37 
38 using XErrorHandler = int (*)(Display*, XErrorEvent*);
39 
40 #endif  // COMMON_XLIB_WITH_UNDEFS_H_
41