mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
MSVC error: 'pos_' is not a member of 'BrotliBitReader' #10
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @anthrotype on GitHub (Aug 10, 2015).
after today's commit
94cd7085f7, I'm getting this error when trying to compile the Python extension on Windows. I'm using Microsoft Visual C compiler from Visual Studio 2010.Cheers,
Cosimo
@lvandeve commented on GitHub (Aug 10, 2015):
Thanks for the report, should be fixed now :)
@anthrotype commented on GitHub (Aug 10, 2015):
thanks!
it compiles now!
It is a bit strange though, because even with the undefined
pos_member, the decoder was still compiling fine on OS X (clang) whereas it wasn't on Windows (msvc)...I believe the reason is because in the
port.hmodule, theBROTLI_LITTLE_ENDIANpreprocessor flag is not being set for MSVC, whereas it should be, as I'm compiling on a little endian processor -- like virtually all Windows machines -- and for a 32-bit Python.I suspect the problem could be that MSVC does not define
__BYTE_ORDER__, and therefore the following check fromport.hdoes not work on Windows:For example, see: http://www.reactos.org/pipermail/ros-diffs/2014-January/051494.html
I think it would be OK to simply assume that Windows is always little endian.
WDYT?
@anthrotype commented on GitHub (Aug 10, 2015):
if I change
port.hlike that, then it compiles fine on MSVC as well (even without applying patch #130):that's because, when
BROTLI_LITTLE_ENDIANis defined, the pre-processor will trim the#elsebranch insidedec/bit_reader.hwhere the undefinedpos_was used.@lvandeve commented on GitHub (Aug 10, 2015):
Yeah I was just noticing the same thing, I did it with "_WIN32" instead, visual studio does not appear to have any flags related to endianness but _WIN32 can be assumed to be LE.
@anthrotype commented on GitHub (Aug 10, 2015):
that's great! thank you 👍
@anthrotype commented on GitHub (Aug 10, 2015):
PS: maybe it'd be a good to set up Appveyor to make sure we test compiling Brotli on Windows...