Commits

Anonymous committed 7061bba

CWS new_itemsets: introduced GCC_VERSION macro, to enable version dependant optimizations

  • Participants
  • Parent commits a8ad47e

Comments (0)

Files changed (3)

File sal/inc/sal/config.h

  * allows it to compile and not break the others.  Other compilers may follow
  * with this eror later. */
 #if defined __GNUC__
-#if ((__GNUC__ == 3) && (__GNUC_MINOR__ > 2))
+#define GCC_VERSION (__GNUC__ * 10000 \
+    + __GNUC_MINOR__ * 100 \
+    + __GNUC_PATCHLEVEL__)
+
+#if (GCC_VERSION > 302000)
 #  define SAL_ISO_CONST const
 #else
 #  define SAL_ISO_CONST

File sal/inc/sal/types.h

 
 #if defined(__GNUC__)
 #define SAL_NOTHROW __attribute__ ((nothrow))
-#define SAL_FLATFUNCTION __attribute__ ((flatten))
-#define SAL_HOTFUNCTION __attribute__ ((hot))
 #else /* __GNUC__ */
 #define SAL_NOTHROW
+#endif /* __GNUC__ */
+
+#if (defined(__GNUC__) && (GCC_VERSION > 40300))
+#define SAL_HOTFUNCTION __attribute__ ((hot))
+#else
+#define SAL_HOTFUNCTION
+#endif
+
+#if (defined(__GNUC__) && (GCC_VERSION > 40100))
+#define SAL_FLATFUNCTION __attribute__ ((flatten))
+#else
 #define SAL_FLATFUNCTION
-#define SAL_HOTFUNCTION
-#endif /* __GNUC__ */
+#endif
 
 #endif /*_SAL_TYPES_H_ */
 

File svl/inc/svl/itemset.hxx

         typedef int ushort_arg_t;
         SfxItemSet(const SfxItemSet&);
 
-	SAL_FLATFUNCTION SAL_HOTFUNCTION SAL_NOTHROW SfxItemSet(SfxItemPool&, bool bTotalPoolRanges = true /* ignored */);
+	    SAL_FLATFUNCTION SAL_HOTFUNCTION SAL_NOTHROW SfxItemSet(SfxItemPool&, bool bTotalPoolRanges = true /* ignored */);
         SAL_FLATFUNCTION SAL_HOTFUNCTION SAL_NOTHROW SfxItemSet(SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2);
         SAL_FLATFUNCTION SAL_HOTFUNCTION SAL_NOTHROW SfxItemSet(SfxItemPool&, ushort_arg_t nWh1, ushort_arg_t nWh2, ushort_arg_t nNull, ...);
         SAL_FLATFUNCTION SAL_HOTFUNCTION SAL_NOTHROW SfxItemSet(SfxItemPool&, const sal_uInt16* nWhichPairTable);