- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
identifier "__builtin_expect" is undefined
please explain.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a GNU builtin (an extension to the GNU compiler) described here:
http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
I believe we make this available in our Windows compiler (icl) as well, although Microsoft does not.
Judy
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To begin with, the answers for Windows (in short, define it away) are different from those for linux or Mac. Did any of the web search results (too many to discuss here) relate to your question?
The feature may have been added to icc to support linux kernel builds. That doesn't mean it's a good idea to use it in your own code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using Windows 7 x64 and Intel compiler v14 the code is from quicklz.c here: www.quicklz.com/download.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a GNU builtin (an extension to the GNU compiler) described here:
http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
I believe we make this available in our Windows compiler (icl) as well, although Microsoft does not.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This directive is perfectly usable across Linux or Windows with that kind of macro
#if defined(__GNUC__) || defined(__ICL) || defined(__clang__) #define EXPECT(x, y) (__builtin_expect((x),(y))) #else #define EXPECT(x, y) (x) #endif
Right now only Microsoft C++ does'nt support it and with ICL (Windows Intel Compiler), it is very effective (it does what it's expected to).
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page