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

Skip to content

Conversation

@pyhalov
Copy link

@pyhalov pyhalov commented Dec 1, 2016

…w build with -std=c99

@brammool
Copy link
Contributor

brammool commented Dec 1, 2016

Since when is "__sun" defined? Perhaps we still need "sun" for older systems.
Old Sun systems tend to die out very slowly...

@dhduvall
Copy link
Contributor

dhduvall commented Dec 1, 2016

It's defined by the compiler, so it depends on how old a compiler you think people are using. __sun is documented by the Studio compilers as far back as 4.2, which dates to 1996. The next oldest copy I found is 2.0.1, dating from 1993, and that only documents sun. GCC 3.4.3 (dated 2005) predefines it, too. I don't know how much further back that one supports it.

@tgc
Copy link

tgc commented Dec 2, 2016

gcc 2.95 also defines __sun.

$ uname -srp
SunOS 5.6 sparc
$ /usr/tgcware/gcc29/bin/gcc -E -dM - < /dev/null | grep sun
#define __sun 1 
#define __sun__ 1 
#define sun 1 

See also the 'Solaris' section here:
https://sourceforge.net/p/predef/wiki/OperatingSystems/

@brammool
Copy link
Contributor

brammool commented Dec 2, 2016 via email

@dhduvall
Copy link
Contributor

dhduvall commented Dec 2, 2016

Do you have any evidence of people using twenty-plus-year-old compilers to compile vim on Solaris (well, SunOS at that point, I guess)? If not, I think just using __sun should be fine. If so, then perhaps

#if defined(sun) && !defined(__sun)
# define __sun 1
#endif

and then you get to use the modern macro.

@brammool brammool closed this in a899e6e Dec 3, 2016
desvp pushed a commit to desvp/vim that referenced this pull request May 30, 2017
Problem:    Modern Sun compilers define "__sun" instead of "sun".
Solution:   Use __sun. (closes vim#1296)
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.

4 participants