Giter Site home page Giter Site logo

Comments (8)

slouken avatar slouken commented on July 17, 2024

Can you check with SDL3 (main code on GitHub)? It looks to me like it will define SDL_FALLTHROUGH to 0 in your case.

from sdl.

madebr avatar madebr commented on July 17, 2024

What is the output of the following command? So we know what macros your compiler automatically defines.
Replace $CC with the path to your actual non-gnu c compiler.

echo "" | $CC -E -dM -xc -

from sdl.

icculus avatar icculus commented on July 17, 2024

(EDIT: this is on an Intel machine, so the GCC output isn't going to have any Sparc defines.)

This is from the gcc3 I installed from...somewhere.

#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 2147483647
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __FLT_EVAL_METHOD__ 2
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 3
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __unix 1
#define __LDBL_MAX_EXP__ 16384
#define __SCHAR_MAX__ 127
#define __USER_LABEL_PREFIX__ 
#define __STDC_HOSTED__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __DBL_DIG__ 15
#define __FLT_EPSILON__ 1.19209290e-7F
#define __LDBL_MIN__ 3.36210314311209350626e-4932L
#define __unix__ 1
#define __DECIMAL_DIG__ 21
#define __LDBL_HAS_QUIET_NAN__ 1
#define __GNUC__ 3
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_HAS_INFINITY__ 1
#define __SVR4 1
#define __DBL_MAX_EXP__ 1024
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __GXX_ABI_VERSION 1002
#define __FLT_MIN_EXP__ (-125)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DBL_HAS_QUIET_NAN__ 1
#define __tune_i386__ 1
#define __sun 1
#define __REGISTER_PREFIX__ 
#define __NO_INLINE__ 1
#define __i386 1
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "3.4.3 (csl-sol210-3_4-branch+sol_rpath)"
#define i386 1
#define sun 1
#define unix 1
#define __i386__ 1
#define __SIZE_TYPE__ unsigned int
#define __ELF__ 1
#define __FLT_RADIX__ 2
#define __LDBL_EPSILON__ 1.08420217248550443401e-19L
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 2147483647L
#define __FLT_HAS_INFINITY__ 1
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __LDBL_MANT_DIG__ 64
#define __WCHAR_TYPE__ long int
#define __FLT_DIG__ 6
#define __INT_MAX__ 2147483647
#define __FLT_MAX_EXP__ 128
#define __DBL_MANT_DIG__ 53
#define __WINT_TYPE__ long int
#define __LDBL_MIN_EXP__ (-16381)
#define __LDBL_MAX_10_EXP__ 4932
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __sun__ 1
#define __svr4__ 1
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __GNUC_MINOR__ 4
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
#define __PTRDIFF_TYPE__ int
#define __LDBL_MIN_10_EXP__ (-4931)
#define __LDBL_DIG__ 18

Sun's compiler doesn't understand these command line options, BUT: their cc manpage lists all predefined macros:

  Predefinitions:unix
		      sparc (SPARC)
		      sun

	  The above are	not predefined in -Xc mode.
	  These	predefinitions are valid in all	modes:
		   __BUILTIN_VA_ARG_INCR
		   __SUNPRO_C=0x5120
		   __SVR4 (Oracle Solaris)
		   __SunOS_5_10	(Oracle	Solaris)
		   __SunOS_5_11	(Oracle	Solaris)
		   __amd64 (x86	-m64)
		   __gnu__linux	(linux)
		   __i386 (x86)
		   __linux (linux)
		   __linux__ (linux)
		   __sparc (SPARC)
		   __sparcv8 (SPARC)
		   __sparcv9 (SPARC -m64)
		   __sun (Oracle Solaris)
		   __unix
		   __`uname -s`_`uname -r | tr . _`
		   __x86_64 (x86 -m64)
		   linux (x86, linux)
	  The following	is predefined in -Xa and -Xt modes only:
		   __RESTRICT
	  The compiler also predefines the object-like macro
		   __PRAGMA_REDEFINE_EXTNAME
	  to indicate the pragma will be recognized.

from sdl.

icculus avatar icculus commented on July 17, 2024

Now that I've got Solaris Studio installed, though, I can say for certain that it's landing in the #if defined(__has_attribute) block in begin_code.h.

from sdl.

icculus avatar icculus commented on July 17, 2024

If I try to compile a test.c file with just the word __has_attribute in it, Sun's compiler fires an internal error that says "unknown feature test macro", so clearly it has some magic for this keyword built in. We should just check for __SUNPRO_C before checking for __has_attribute support.

from sdl.

icculus avatar icculus commented on July 17, 2024

Sorry for all the spam here. A newer manpage lists that as predefined:

The following values are predefined.

SPARC and x86 platforms:

__ARRAYNEW
__BUILTIN_VA_ARG_INCR
__DATE__
__FILE__
__LINE__
__STDC__ = 0
__SUNPRO_CC = 0x5150
__SUNPRO_CC_COMPAT = 5 or G
__TIME__
__cplusplus
__has_attribute
__sun
__unix
_BOOL if type bool is enabled (see "-features=[no%]bool")
_WCHAR_T
sun
unix
__SVR4 (Oracle Solaris)
__SVR4__ (Oracle Solaris)
__svr4__ (Oracle Solaris)
__SunOS_RELEASE (Oracle Solaris)
__SunOS_5_10  (Oracle Solaris)
__SunOS_5_11  (Oracle Solaris)
_LP64  (-m64)
__LP64__  (-m64)

Note: __has_attribute is a function-like macro.

A hex value 0xRRrrmm representing the Oracle Solaris release, where RR.rr is the output of the sysinfo (SI_RELEASE) system call, or of the uname -r command, with leading zeros added when needed. The mm digits are reserved for possible future "micro" releases. All the digits are decimal. Example for Oracle Solaris 11, which is SunOS 5.11: __SunOS_RELEASE, has the value, 0x051100 . The value of __SunOS_RELEASE for an older Oracle Solaris release is always less than the value for a later release. Example of use:

#if __SunOS_RELEASE >= 0x051100 // Solaris 11 or later.

SPARC only:

sparc
sparcv8
__SUN_PREFETCH = 1
__sparc

SPARC V9 only:

__sparcv9 (with -m64)

x86 only:

linux
__amd64 (with -m64)
__gnu__linux__
__linux
__linux__
__x86_64 (with -m64)
__i386__ (with -m32)

Note that __sun is only defined on Oracle Solaris platforms. Use __SUNPRO_CC to determine if the compiler is the Oracle Developer Studio CC compiler.

from sdl.

icculus avatar icculus commented on July 17, 2024

Having worked around the fallthrough thing, here's the configure output and compiler output from Sun's compiler, in case it's interesting.

from sdl.

icculus avatar icculus commented on July 17, 2024

I've pushed a fix for this specific bug, but feel free to steal any above info for the other Solaris issues that were posted.

from sdl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.