Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d1f46a7d
Commit
d1f46a7d
authored
Mar 18, 2005
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set _XOPEN_SOURCE differently depending on __STDC_VERSION__
[sigh]
parent
04e02715
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
include/my_global.h
include/my_global.h
+22
-5
No files found.
include/my_global.h
View file @
d1f46a7d
...
@@ -121,19 +121,36 @@
...
@@ -121,19 +121,36 @@
#endif
#endif
/*
/*
Solaris include file <sys/feature_tests.h> refers to X/Open document
Solaris
9
include file <sys/feature_tests.h> refers to X/Open document
System Interfaces and Headers, Issue 5
System Interfaces and Headers, Issue 5
saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes
saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes
,
but apparently other systems (namely FreeBSD) don't agree.
but apparently other systems (namely FreeBSD) don't agree.
Furthermore X/Open has since 2004 "System Interfaces, Issue 6"
that dictates _XOPEN_SOURCE=600, but Solaris checks for 500.
On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
So, let's define 500 for solaris only.
Furthermore, it tests that if a program requires older standard
(_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
run on a new compiler (that defines _STDC_C99) and issues an #error.
It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
C++ compiler does not!
So, in a desperate attempt to get correct prototypes for both
C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500
depending on the compiler's announced C standard support.
Cleaner solutions are welcome.
*/
*/
#ifdef __sun
#ifdef __sun
#if __STDC_VERSION__ - 0 >= 199901L
#define _XOPEN_SOURCE 600
#else
#define _XOPEN_SOURCE 500
#define _XOPEN_SOURCE 500
#endif
#endif
#endif
#if defined(THREAD) && !defined(__WIN__) && !defined(OS2)
#if defined(THREAD) && !defined(__WIN__) && !defined(OS2)
#ifndef _POSIX_PTHREAD_SEMANTICS
#ifndef _POSIX_PTHREAD_SEMANTICS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment