shithub: cstory

Download patch

ref: afd3abecc44812a0748caac0fa47b0612f62160d
parent: f68984bd58715c1f39de06247a4ef14181129822
author: Gabriel Ravier <gabravier@gmail.com>
date: Thu Apr 2 20:43:34 EDT 2020

Correctly used Attributes.h instead of a definition directly in SoftwareMixer.cpp

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>

--- a/src/Backends/Audio/SoftwareMixer.cpp
+++ b/src/Backends/Audio/SoftwareMixer.cpp
@@ -5,17 +5,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include "../../Attributes.h"
 
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #define CLAMP(x, y, z) MIN(MAX((x), (y)), (z))
 
-#ifdef __GNUC__
-#define ATTR_HOT __attribute__((hot))
-#else
-#define ATTR_HOT
-#endif
-
 struct Mixer_Sound
 {
 	unsigned char *samples;
@@ -144,7 +139,7 @@
 }
 
 // Most CPU-intensive function in the game (2/3rd CPU time consumption in my experience), so marked with attrHot so the compiler considers it a hot spot (as it is) when optimizing
-ATTR_HOT void Mixer_MixSounds(float *stream, unsigned int frames_total)
+ATTRIBUTE_HOT void Mixer_MixSounds(float *stream, unsigned int frames_total)
 {
 	for (Mixer_Sound *sound = sound_list_head; sound != NULL; sound = sound->next)
 	{
--