From a9b3381f4b42e1641834cbc1dfff4815b625807b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 3 Jun 2010 15:44:40 +0200 Subject: deprecate header files in $$QT_BUILD_TREE/include/Qt To resolve the header file conflict as described in QTBUG-10647, we * remove include/Qt/private * "syncqt -copy" creates in include/Qt local forwarding headers instead of header file copies In case of a conflict, e.g. qxmlstream.h, we include both header files. All header files in include/Qt now yield a preprocessor warning, if they're included. They should not be used and will vanish some day. Task-number: QTBUG-10647 Reviewed-by: ossi --- bin/syncqt | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/bin/syncqt b/bin/syncqt index f993fd9..f499bbc 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -681,6 +681,7 @@ $isunix = checkUnix; #cache checkUnix # create path mkpath "$out_basedir/include", !$quiet; +mkpath "$out_basedir/include/Qt", !$quiet; my @ignore_headers = (); my $class_lib_map_contents = ""; @@ -689,6 +690,7 @@ my @ignore_for_include_check = ( "qatomic.h" ); my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" ); my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" ); my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" ); +my %colliding_headers = (); foreach (@modules_to_sync) { #iteration info @@ -828,8 +830,30 @@ foreach (@modules_to_sync) { my @headers; if ($public_header) { @headers = ( "$out_basedir/include/$lib/$header" ); - push @headers, "$out_basedir/include/Qt/$header" - if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/); + + # write forwarding headers to include/Qt + if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/) { + my $file_name = "$out_basedir/include/Qt/$header"; + my $header_content = ''; + if (exists $colliding_headers{$file_name}) { + $file_name = ">>$file_name"; + } else { + $colliding_headers{$file_name} = 1; + $file_name = ">$file_name"; + my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.'; + $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" . + " #if defined(__GNUC__)\n" . + " #pragma warning \"$warning_msg\"\n" . + " #elif defined(_MSC_VER)\n" . + " #pragma message \"WARNING: $warning_msg\"\n" . + " #endif\n". + "#endif\n\n"; + } + $header_content .= '#include "' . "../$lib/$header" . "\"\n"; + open HEADERFILE, $file_name; + print HEADERFILE $header_content; + close HEADERFILE; + } foreach(@classes) { my $header_base = basename($header); @@ -849,8 +873,6 @@ foreach (@modules_to_sync) { } } elsif ($create_private_headers) { @headers = ( "$out_basedir/include/$lib/private/$header" ); - push @headers, "$out_basedir/include/Qt/private/$header" - if ("$lib" ne "phonon"); } foreach(@headers) { #sync them $header_copies++ if(syncHeader($_, $iheader, $copy_headers)); -- cgit v0.12