llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.05k stars 11.58k forks source link

llvm-rc doesn't support MENU entries in DIALOGEX resource declaration #49559

Closed zefklop closed 4 months ago

zefklop commented 3 years ago
Bugzilla Link 50215
Version trunk
OS All

Extended Description

What the title says.

Documented here: https://docs.microsoft.com/en-us/windows/win32/menurc/dialogex-resource

Example of such a resource can be found at: https://git.reactos.org/?p=reactos.git;a=blob;f=base/applications/calc/lang/fr-FR.rc;h=edf5d672309cf71218862719b52933abbe408fed;hb=HEAD#l5

csm-kb commented 9 months ago

+1, I just ran into this issue while creating an audio plugin via the iPlug2 helper! Using

clang version 17.0.1
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin

installed via official page, and project compiled via CMake/Ninja -- build tooling does not affect the result.

Build completes successfully if I omit the MENU IDR_MENU1 entry below from the DIALOGEX declaration.


Expected:

llvm-rc parses MENU as a valid optional parameter of DIALOGEX.

Actual:

llvm-rc: Error parsing file: expected optional statement type, BEGIN or '{', got MENU

Details:

Valid main.rc file declaration snip:

#include "resource.h"
#include "winres.h"

IDD_DIALOG_MAIN DIALOGEX 0, 0, 300, 300
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Sample"
MENU IDR_MENU1
FONT 8, "MS Sans Serif"
BEGIN
END

IDR_MENU1 MENU
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "&Preferences...\tCtrl+,", ID_PREFERENCES
        MENUITEM "&Quit", ID_QUIT
    END
END

with resource.h:

#define IDD_DIALOG_MAIN 40001
#define IDR_MENU1       40004
#define ID_PREFERENCES  40006
#define ID_QUIT         40007

Another resource example from an ancient thread here. Curious to know where this is emanating from deep in the dark depths of llvm-rc...