Skip to content

Commit 3d82edf

Browse files
committed
[graf3d] Fix errors and warnings due to TGLWSIncludes.h
The TGLWSIncludes.h header is being removed from the public interface in v6.40. Due to using a >= instead of =, it was causing a compiler error already in v6.38, where it was supposed to raise only a warning. Now, the public header unconditionally raises a warning in Linux and Mac, and a local version of this header is added to graf3d/src, which allows for ROOT to compile without warnings.
1 parent 556b0ca commit 3d82edf

File tree

6 files changed

+36
-15
lines changed

6 files changed

+36
-15
lines changed

graf3d/gl/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,6 @@ else()
232232
target_include_directories(RGL PRIVATE ${GL2PS_INCLUDE_DIRS})
233233
endif()
234234

235-
# Remove when not needed anymore in the ROOT 6.40 development cycle
236-
target_compile_definitions(RGL PRIVATE _ROOT_GL_BUILDS_ITSELF)
237-
238235
if(MSVC AND builtin_glew)
239236
target_compile_definitions (RGL PRIVATE "GLEW_STATIC")
240237
endif()

graf3d/gl/inc/TGLWSIncludes.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@
1818

1919
// This header is deprecated according to
2020
// https://its.cern.ch/jira/browse/ROOT-9807
21-
// In the 6.38 release, our users will get a warning, and then in 6.40 we
22-
// remove this header. Conditional on the ROOT version, this header will give
23-
// an error on inclusion to remind us to move it. Remove also the
24-
// _ROOT_GL_BUILDS_ITSELF definition from the CMakeLists.txt then.
25-
#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 38, 00)
26-
#error "Header should be moved outside of the public ROOT interface now"
27-
#else
28-
#ifndef _ROOT_GL_BUILDS_ITSELF
21+
#ifndef _WIN32
2922
#warning "The TGLWSIncludes.h header is deprecated and will be removed in ROOT 6.40"
3023
#endif
31-
#endif
3224

3325

3426
#include "RConfigure.h"

graf3d/gl/src/TGLContextPrivate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <map>
88

99
#include "TGLIncludes.h"
10-
#include "TGLWSIncludes.h"
10+
#include "TGLWSIncludes_local.h"
1111
#include "TGLContext.h"
1212
#include "RConfigure.h"
1313
#include "GuiTypes.h"

graf3d/gl/src/TGLFormat.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <set>
1515

1616
#include "TGLFormat.h"
17-
#include "TGLWSIncludes.h"
17+
#include "TGLWSIncludes_local.h"
1818
#include "TGLWidget.h"
1919

2020
#include "TEnv.h"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @(#)root/gl:$Id$
2+
// Authors: Timur and Matevz, May 2008
3+
4+
/*************************************************************************
5+
* Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6+
* All rights reserved. *
7+
* *
8+
* For the licensing terms see $ROOTSYS/LICENSE. *
9+
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10+
*************************************************************************/
11+
12+
// Window-system specific GL includes.
13+
// Inclusion should only be necessary in in low-level system files.
14+
15+
#ifndef ROOT_TGLWSIncludes_local
16+
#define ROOT_TGLWSIncludes_local
17+
18+
#include "RConfigure.h"
19+
#include "TGLIncludes.h"
20+
21+
#if defined(WIN32)
22+
# include <GL/wglew.h>
23+
#else
24+
# if defined(__APPLE__) && !defined(R__HAS_COCOA)
25+
# define GLEW_APPLE_GLX
26+
# endif
27+
# if !defined(R__HAS_COCOA)
28+
# include <GL/glxew.h>
29+
# endif
30+
#endif
31+
32+
#endif

graf3d/gl/src/TGLWidget.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "TGLWidget.h"
2222
#include "TGLIncludes.h"
23-
#include "TGLWSIncludes.h"
23+
#include "TGLWSIncludes_local.h"
2424
#include "TGLUtil.h"
2525
#include "TGLEventHandler.h"
2626
#include "RConfigure.h"

0 commit comments

Comments
 (0)