Results 1 to 4 of 4

Thread: liblzma and MSVC

  1. #1
    Programmer schnaader's Avatar
    Join Date
    May 2008
    Location
    Hessen, Germany
    Posts
    539
    Thanks
    192
    Thanked 174 Times in 81 Posts

    liblzma and MSVC

    In a Precomp branch on Github, I added on-the-fly compression/decompression using liblzma. Using MinGW, everything compiles fine after some minor adjustments. Then I tried to update the MSVC solution (with this commit). I had to use an inttypes.h replacement and even after that, there are thousands of errors. It seems there is some problem using the "inline" keyword in C in MSVC. Usually, this should be fixed using "__inline" instead, which liblzma does (in sysdefs.h):

    Code:
    // As of MSVC 2013, inline and restrict are supported with
    // non-standard keywords.
    #if defined(_WIN32) && defined(_MSC_VER)
    #	ifndef inline
    #		define inline __inline
    #	endif
    #	ifndef restrict
    #		define restrict __restrict
    #	endif
    #endif
    But sadly, neither this nor commenting the above code works, both lead to many errors in or around inlined functions. I'm using MSVC 2012, perhaps this is better in MSVC 2013/2015, could anyone check?

    Any help or hints would be appreciated. As maintaing the MSVC solution gets more and more cumbersome with things like this, I think about supporting only MinGW on Windows and removing the Visual Studio project.
    http://schnaader.info
    Damn kids. They're all alike.

  2. #2
    Member
    Join Date
    Jul 2013
    Location
    United States
    Posts
    194
    Thanks
    44
    Thanked 140 Times in 69 Posts
    We build liblzma as part of Squash with VS 12 (2013) and 14 (2015), it works. That said, __inline has been around since at least VS 6, and __restrict since VS 2005. Are you sure they are what is causing the errors?

  3. #3
    Member
    Join Date
    Jan 2016
    Location
    India
    Posts
    20
    Thanks
    23
    Thanked 8 Times in 7 Posts
    any news about difflate

    sorry,for the off topic question
    Last edited by PrinceGupta; 3rd July 2016 at 14:19.

  4. #4
    Programmer schnaader's Avatar
    Join Date
    May 2008
    Location
    Hessen, Germany
    Posts
    539
    Thanks
    192
    Thanked 174 Times in 81 Posts
    It's Visual Studio 2012 that doesn't work with liblzma because it lacks C99 support. It's even in the XZ utils documentation, as sftt (the Precomp branch author) pointed out - from windows\INSTALL-MSVC.txt:

    MSVC 2013 update 2 and later have enough C99 support to build
    liblzma from XZ Utils 5.2.0 and later without modifications.
    Older MSVC versions would require a large number of changes to
    the XZ Utils code and thus the old MSVC versions aren't supported.
    ---

    Quote Originally Posted by PrinceGupta View Post
    any news about difflate
    I'm working on it, adjusting, cleaning and documenting the code so I can push an usable initial commit.
    http://schnaader.info
    Damn kids. They're all alike.

  5. The Following User Says Thank You to schnaader For This Useful Post:

    PrinceGupta (6th July 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •