[Git][wxwidgets/wxwidgets][master] 2 commits: Fix wxGTK compilation with wxUSE_STD_STRING_CONV_IN_WXSTRING

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Jul 28, 2025, 11:56:42 AMJul 28
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 666f7489
    by Vadim Zeitlin at 2025-07-28T16:18:20+02:00
    Fix wxGTK compilation with wxUSE_STD_STRING_CONV_IN_WXSTRING
    
    Don't rely on implicit conversion to "char*" which may be unavailable
    and call utf8_str() explicitly instead.
    
    See afb11cf2eb (Use system default titlebar decorations under Wayland,
    2025-06-25) and #25562.
    
  • 55fd0086
    by Vadim Zeitlin at 2025-07-28T16:19:47+02:00
    Restore CI jobs with wxUSE_STD_STRING_CONV_IN_WXSTRING=1
    
    After the changes 35c35c235e (Remove wxUSE_STL which is not really used
    any longer, 2023-04-15) there were no more CI builds using wxString
    without implicit conversion to "char*", so errors like the one fixed in
    the parent commit were not detected any more.
    
    Add builds using wxUSE_STD_STRING_CONV_IN_WXSTRING=1 which disables
    conversions to "char*" in wxString to ensure this doesn't happen again.
    

5 changed files:

Changes:

  • .github/workflows/ci.yml
    ... ... @@ -113,14 +113,14 @@ jobs:
    113 113
                 extra_warnings: -Wsuggest-override
    
    114 114
                 use_xvfb: true
    
    115 115
                 check_headers: true
    
    116
    -          - name: Ubuntu 24.04 wxGTK with ASAN
    
    116
    +          - name: Ubuntu 24.04 wxGTK ASAN not compatible
    
    117 117
                 runner: ubuntu-24.04
    
    118
    -            configure_flags: --disable-compat32 --disable-sys-libs
    
    118
    +            configure_flags: --enable-std_string_conv_in_wxstring --disable-compat32 --disable-sys-libs
    
    119 119
                 extra_warnings: -Wsuggest-override
    
    120 120
                 skip_samples: true
    
    121 121
                 use_asan: true
    
    122 122
                 use_xvfb: true
    
    123
    -          - name: Ubuntu 24.04 wxGTK with UBSAN
    
    123
    +          - name: Ubuntu 24.04 wxGTK UBSAN
    
    124 124
                 runner: ubuntu-24.04
    
    125 125
                 configure_flags: --with-cxx=20
    
    126 126
                 extra_warnings: -Wsuggest-override
    

  • .github/workflows/ci_mac.yml
    ... ... @@ -82,9 +82,10 @@ jobs:
    82 82
           fail-fast: false
    
    83 83
           matrix:
    
    84 84
             include:
    
    85
    -        - name: wxMac ARM with ASAN
    
    85
    +        - name: wxMac ARM ASAN not compatible
    
    86 86
               runner: self-hosted
    
    87 87
               arch: arm64
    
    88
    +          configure_flags: --enable-std_string_conv_in_wxstring --disable-compat32 --disable-sys-libs
    
    88 89
               use_asan: true
    
    89 90
             - name: wxMac Intel C++17
    
    90 91
               runner: macos-14
    

  • .github/workflows/ci_msw.yml
    ... ... @@ -71,6 +71,7 @@ jobs:
    71 71
                 platform: 'Win32'
    
    72 72
                 use_cxx20: true
    
    73 73
               - configuration: 'DLL Release'
    
    74
    +            use_std_string: true
    
    74 75
                 platform: 'x64'
    
    75 76
     
    
    76 77
         steps:
    
    ... ... @@ -82,10 +83,12 @@ jobs:
    82 83
           - name: Configure build options
    
    83 84
             working-directory: include/wx/msw
    
    84 85
             run: |
    
    86
    +            $use_std_string = "${{ matrix.use_std_string }}" ? 1 : 0
    
    85 87
                 $use_utf8 = "${{ matrix.use_utf8 }}" ? 1 : 0
    
    86
    -            if ( $use_utf8 ) {
    
    88
    +            if ( $use_std_string -or $use_utf8 ) {
    
    87 89
                   $txt = Get-Content setup.h
    
    88 90
                   Write-Output $txt |
    
    91
    +              %{$_ -replace "define wxUSE_STD_STRING_CONV_IN_WXSTRING 0", "define wxUSE_STD_STRING_CONV_IN_WXSTRING $use_std_string"} |
    
    89 92
                   %{$_ -replace "define wxUSE_UNICODE_UTF8 0", "define wxUSE_UNICODE_UTF8 $use_utf8"} |
    
    90 93
                   Set-Content setup.h
    
    91 94
                 }
    

  • .github/workflows/ci_msw_cross.yml
    ... ... @@ -74,9 +74,9 @@ jobs:
    74 74
           fail-fast: false
    
    75 75
           matrix:
    
    76 76
             include:
    
    77
    -          - name: wxMSW 64 bits
    
    77
    +          - name: wxMSW 64 bits not compatible
    
    78 78
                 debian_release: testing
    
    79
    -            configure_flags: --disable-compat32
    
    79
    +            configure_flags: --enable-std_string_conv_in_wxstring --disable-compat32
    
    80 80
               - name: wxMSW 32 bits
    
    81 81
                 # Testing doesn't have 32 bit support any more.
    
    82 82
                 debian_release: stable
    

  • src/gtk/toplevel.cpp
    ... ... @@ -430,7 +430,8 @@ void wxTopLevelWindowGTK::GTKHandleRealized()
    430 430
                     if ((m_gdkFunc & GDK_FUNC_CLOSE) == 0)
    
    431 431
                         layout.Replace("close", empty, false);
    
    432 432
     
    
    433
    -                gtk_header_bar_set_decoration_layout(GTK_HEADER_BAR(titlebar), layout);
    
    433
    +                gtk_header_bar_set_decoration_layout(GTK_HEADER_BAR(titlebar),
    
    434
    +                                                     layout.utf8_str());
    
    434 435
                 }
    
    435 436
     #endif // 3.12
    
    436 437
                 // Don't set WM decorations when GTK is using Client Side Decorations
    

Reply all
Reply to author
Forward
0 new messages