public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* __builtin_expect usage
@ 2001-03-04  5:28 Momchil Velikov
  2001-03-05 11:47 ` Frank Ch. Eigler
  0 siblings, 1 reply; 2+ messages in thread
From: Momchil Velikov @ 2001-03-04  5:28 UTC (permalink / raw)
  To: SID

Hi,

The `__builtin_expect' function in not present in gcc <= 2.95.3.

Regards,
-velco

2001-03-04  Momchil Velikov  <velco@fadata.bg>

	* sidconfig.h (LIKELY, UNLIKELY): Do not try to use
	`__builtin_expect' in versions of gcc less than 3.


--- sidconfig.h~	Thu Mar  1 22:48:37 2001
+++ sidconfig.h	Sun Mar  4 15:20:28 2001
@@ -13,7 +13,7 @@
 
 // Globally useful macros
 
-#ifdef __GNUC__
+#if defined (__GNUC__) && __GNUC__ > 2
 #define LIKELY(expression) (__builtin_expect(!!(expression), 1))
 #define UNLIKELY(expression) (__builtin_expect(!!(expression), 0))
 #else

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: __builtin_expect usage
  2001-03-04  5:28 __builtin_expect usage Momchil Velikov
@ 2001-03-05 11:47 ` Frank Ch. Eigler
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Ch. Eigler @ 2001-03-05 11:47 UTC (permalink / raw)
  To: Momchil Velikov; +Cc: SID

Hi -

On Sun, Mar 04, 2001 at 03:36:56PM +0200, Momchil Velikov wrote:
: The `__builtin_expect' function in not present in gcc <= 2.95.3.
: [...]

Thanks, good point.  Rather than use a __GNUC_VERSION__-based
conditional, I'll commit an autoconf test for the feature instead.

- FChE
-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6o+0fVZbdDOm/ZT0RAm4NAJwJouebvwIleKPyeXTjYeXx/7EXAQCfSSi2
/5hCYbnR8lqQhsEPLIG7DWU=
=C+Du
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-03-05 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-04  5:28 __builtin_expect usage Momchil Velikov
2001-03-05 11:47 ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).