Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make the Visual Studio compiler happy #2684

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

Merged
merged 1 commit into from
Nov 3, 2014
Merged

Make the Visual Studio compiler happy #2684

merged 1 commit into from
Nov 3, 2014

Conversation

jacquesg
Copy link
Contributor

@jacquesg jacquesg commented Nov 3, 2014

The Visual Studio 2008 compiler doesn't like this

# ifdef SSL_OP_NO_COMPRESSION
    | SSL_OP_NO_COMPRESSION
# endif

This PR merely reformats it.

@carlosmn
Copy link
Member

carlosmn commented Nov 3, 2014

Why doesn't it like it? Why is the new method any different from the compiler's point of view?

@jacquesg
Copy link
Contributor Author

jacquesg commented Nov 3, 2014

That I don't know (seeing that it is perfectly valid), here is the output I get:

cl -c  -I. -Ideps/libgit2 -Ideps/libgit2/src -Ideps/libgit2/include -Ideps/libgit2/deps/http-parser -Ideps/libgit2/deps/zlib -IC:/dev/vs2008-x64/include
 -IC:\dev\vs2008-x64\include\openssl -Ideps/libgit2/deps/regex  -nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL -fp:precise -DWIN32 -D_CONSOLE -DNO_STRICT -DWIN64 -DCO
NSERVATIVE -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -MD -Zi -DND
EBUG -Ox -GL -fp:precise    -DVERSION=\"0.49\"  -DXS_VERSION=\"0.49\"  "-IC:\opt\Striata\vs-2008-perl-5.16.1-x64\perl\lib\mswin32\CORE"  -DGIT_SSH -DGIT_SSL -DN
O_VIZ -DSTDC -DNO_GZIP -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DGIT_THREADS -DWIN32 -DGIT_WIN32 -D_CRT_SECURE_NO_WARNINGS deps/libgit2/src/global.c /Fodeps/libgit
2/src/global.obj
global.c
deps/libgit2/src/global.c(87) : error C2121: '#' : invalid character : possibly the result of a macro expansion
deps/libgit2/src/global.c(87) : error C2146: syntax error : missing ')' before identifier 'ifdef'
deps/libgit2/src/global.c(87) : error C2121: '#' : invalid character : possibly the result of a macro expansion
deps/libgit2/src/global.c(155) : error C2061: syntax error : identifier '_tls_index'
deps/libgit2/src/global.c(155) : error C2059: syntax error : ';'
deps/libgit2/src/global.c(162) : error C2065: '_tls_index' : undeclared identifier
deps/libgit2/src/global.c(196) : error C2065: '_tls_index' : undeclared identifier
deps/libgit2/src/global.c(219) : error C2065: '_tls_index' : undeclared identifier
deps/libgit2/src/global.c(227) : error C2065: '_tls_index' : undeclared identifier
NMAKE : fatal error U1077: 'C:\VC9\VC\Bin\amd64\cl.EXE' : return code '0x2'
Stop.

@carlosmn
Copy link
Member

carlosmn commented Nov 3, 2014

Maybe it's confused by the space after the '#'? Did you try making it #ifdefinstead # ifdef? I think we do have the space elsewhere, but... sounds like a buggy preprocessor.

@jacquesg
Copy link
Contributor Author

jacquesg commented Nov 3, 2014

That was my first guess, but that also didn't help.

@jacquesg
Copy link
Contributor Author

jacquesg commented Nov 3, 2014

It's definitely a bug in the pre-processor, unfortunately, the only way to work around those is to reformat :/

@ethomson
Copy link
Member

ethomson commented Nov 3, 2014

Sigh, VS 2008.

ethomson added a commit that referenced this pull request Nov 3, 2014
Make the Visual Studio compiler happy
@ethomson ethomson merged commit 2cc6011 into libgit2:master Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants