View Issue Details

IDProjectCategoryView StatusLast Update
0000579OpenMPTlibopenmptpublic2014-08-26 11:05
Reporterwiz Assigned Tomanx  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSNetBSDOS Version7.99.1
Product VersionOpenMPT 1.23.04.00 / libopenmpt 0.2-beta5 (upgrade first) 
Summary0000579: libopenmpt-0.2.4115-beta5: bswap32 redefinition
Description

When compiling on NetBSD, I see lots of warnings like this:

In file included from ./soundlib/plugins/PlugInterface.h:25:0,
from ./soundlib/Sndfile.h:47,
from libopenmpt/libopenmpt_impl.cpp:28:
./soundlib/plugins/../../common/Endianness.h:26:0: warning: "bswap32" redefined [enabled by default]
#define bswap32 __builtin_bswap32
^

The easiest fix is to check for a bswap32 definition before redefining it.
Suggested patch attached.

TagsNo tags attached.
Attached Files
bswap32.diff (690 bytes)   
$NetBSD$

Avoid bswap32 re-definition on NetBSD.

In file included from ./soundlib/plugins/PlugInterface.h:25:0,
                 from ./soundlib/Sndfile.h:47,
                 from libopenmpt/libopenmpt_impl.cpp:28:
./soundlib/plugins/../../common/Endianness.h:26:0: warning: "bswap32" redefined [enabled by default]
 #define bswap32 __builtin_bswap32
 ^

--- common/Endianness.h.orig	2014-06-10 16:27:31.000000000 +0000
+++ common/Endianness.h
@@ -23,8 +23,10 @@ OPENMPT_NAMESPACE_BEGIN
 
 #if MPT_COMPILER_GCC
 #if MPT_GCC_AT_LEAST(4,3,0)
+#ifndef bswap32
 #define bswap32 __builtin_bswap32
 #endif
+#endif
 #elif MPT_COMPILER_MSVC
 #include <intrin.h>
 #define bswap16 _byteswap_ushort
bswap32.diff (690 bytes)   
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

manx

manx

2014-08-26 11:05

administrator   ~0001765

Fixed in r4213.
You can get automatically generated tarball snapshots (with a some minutes delay) at http://buildbot.openmpt.org/builds/ .

Issue History

Date Modified Username Field Change
2014-08-26 10:28 wiz New Issue
2014-08-26 10:28 wiz File Added: bswap32.diff
2014-08-26 11:01 manx Assigned To => manx
2014-08-26 11:01 manx Status new => acknowledged
2014-08-26 11:05 manx Note Added: 0001765
2014-08-26 11:05 manx Status acknowledged => resolved
2014-08-26 11:05 manx Resolution open => fixed