Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build rar2fs with unrar 7.0.7 #186

Open
fdegros opened this issue May 3, 2024 · 3 comments
Open

Cannot build rar2fs with unrar 7.0.7 #186

fdegros opened this issue May 3, 2024 · 3 comments
Labels

Comments

@fdegros
Copy link
Collaborator

fdegros commented May 3, 2024

It looks like the field FileHeader::RedirName has changed its type from wchar_t* to std::wstring, which prevents the compilation of rar2fs with unrar 7.0.7:

See https://bugs.gentoo.org/931078

dllext.cpp: In function ‘int RARListArchiveEx(void*, RARArchiveDataEx**)’:
dllext.cpp:174:46: error: cannot convert ‘std::wstring’ {aka ‘std::__cxx11::basic_string<wchar_t>’} to ‘const wchar_t*’
  174 |           wcscpy(N->LinkTargetW,Arc.FileHead.RedirName);
      |                                 ~~~~~~~~~~~~~^~~~~~~~~
      |                                              |
      |                                              std::wstring {aka std::__cxx11::basic_string<wchar_t>}

The constant NM seems to have been removed as well:

See https://bugs.gentoo.org/930341

dllext.cpp: In function void RARNextVolumeName(char*, bool):
dllext.cpp:214:18: error: NM was not declared in this scope
  214 |   wchar NextName[NM];
      |                  ^~
@hasse69
Copy link
Owner

hasse69 commented May 3, 2024

Thanks for the issue report. Is it possible for you to make a patch for this as I am currently not able to look into this build problem.

@hasse69 hasse69 added the Defect label May 6, 2024
@correabuscar
Copy link

correabuscar commented May 18, 2024

so, is anyone working on a patch for this? trying to avoid the possibility of duplicating work here

EDIT: hmmm, this seems to require quite some consideration to get right, and beforehand knowledge of string formats and how to c++. And some #if RARVER_MAJOR < 7 to keep the previous behavior... But I'm kinda curious how it looks like if i halfass it(like redefining NM) - ok, it can't be halfassed.

I don't know enough c++ to be confident I won't mess it up. I see for example char FileNameUtf[NM] (in rar2fs-1.29.6/src/dllext.cpp) and I wonder if it shouldn't have been char FileNameUtf[NM*4] all along, for the worst case scenario, and this is before even attempting to make it work for the >=7 version. And maybe some size checks about MAXPATHSIZE ...

I leave this to the pros.

@hasse69
Copy link
Owner

hasse69 commented May 19, 2024

Looking at the UnRAR source code usually provides enough details to complete the small extension(s) in rar2fs. The extensions are simply variants of already existing functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants