- Small change to allow building on gcc compilers where the system does not

use glibc (*BSD for example)  __GNUC_PREREQ seems to be a glibc feature,
  and not always available on other systems.

  I've renamed my macro to *hopefully* avoid name clashes.

-#if defined(__GNUC__) && __GNUC_PREREQ(3,0)
+
+#if defined(__GNUC__) && defined(__GNUC_MINOR__)
+#define KDE_GNUC_PREREQ(maj,min) \
+  ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+#define KDE_GNUC_PREREQ(maj,min) 0
+#endif
+
+#if defined(__GNUC__) && KDE_GNUC_PREREQ(3,0)

svn path=/trunk/kdebase/nsplugins/; revision=166365
This commit is contained in:
Andy Fawcett 2002-07-13 05:21:10 +00:00
parent 60026abcc9
commit 282dc5b425
2 changed files with 19 additions and 2 deletions

View file

@ -56,7 +56,15 @@
#include "sdk/npupp.h"
// provide these symbols when compiling with gcc 3.x
#if defined(__GNUC__) && __GNUC_PREREQ(3,0)
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
#define KDE_GNUC_PREREQ(maj,min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else
#define KDE_GNUC_PREREQ(maj,min) 0
#endif
#if defined(__GNUC__) && KDE_GNUC_PREREQ(3,0)
extern "C" void* __builtin_new(size_t s)
{
return operator new(s);

View file

@ -55,7 +55,16 @@
#include <Xm/DrawingA.h>
// provide these symbols when compiling with gcc 3.x
#if defined(__GNUC__) && __GNUC_PREREQ(3,0)
#if defined __GNUC__ && defined __GNUC_MINOR__
# define KDE_GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else
# define KDE_GNUC_PREREQ(maj, min) 0
#endif
#if defined(__GNUC__) && KDE_GNUC_PREREQ(3,0)
extern "C" void* __builtin_new(size_t s)
{
return operator new(s);