View Issue Details

IDProjectCategoryView StatusLast Update
0000720OpenMPTlibopenmptpublic2015-11-06 12:06
Reporterwiz Assigned Tomanx  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSNetBSDOS Version7.99.1
Product VersionOpenMPT 1.25.03.* (old testing) 
Fixed in VersionOpenMPT 1.25.03.* (old testing) 
Summary0000720: libopenmpt-0.2.5705: bswap16 redefinition
Description

When compiling on NetBSD, there are lots of redefinition warnings for bswap16, like this:

In file included from soundlib/../common/FileReader.h:17:0,
from soundlib/Loaders.h:13,
from soundlib/Load_mdl.cpp:13:
soundlib/../common/Endianness.h:31:0: warning: "bswap16" redefined [enabled by default]
#define bswap16 __builtin_bswap16
^
In file included from /usr/include/amd64/bswap.h:13:0,
from /usr/include/sys/endian.h:107,
from /usr/include/amd64/endian.h:3,
from /usr/include/sys/types.h:98,
from /usr/include/sys/time.h:38,
from /usr/include/time.h:142,
from /usr/include/pthread.h:37,
from /usr/include/g++/bits/gthr-default.h:35,
from /usr/include/g++/bits/gthr.h:152,
from /usr/include/g++/ext/atomicity.h:35,
from /usr/include/g++/memory:73,
from ./common/../common/typedefs.h:160,
from ./common/stdafx.h:51,
from soundlib/Load_mdl.cpp:12:
/usr/include/sys/bswap.h:71:0: note: this is the location of the previous definition
#define bswap16(x) \
^

Steps To Reproduce

Compile on NetBSD.

Additional Information

When I replace, in common/Endianness.h, in this block:

#if MPT_COMPILER_GCC
#if MPT_GCC_AT_LEAST(4,8,0)
#define bswap16 __builtin_bswap16
#endif

"bswap16" with "MPT_bswap16", the warnings go away.

TagsNo tags attached.
Attached Files
patch-common_Endianness.h.diff (344 bytes)   
$NetBSD$

--- common/Endianness.h.orig	2015-06-13 11:59:24.000000000 +0000
+++ common/Endianness.h
@@ -28,7 +28,7 @@ OPENMPT_NAMESPACE_BEGIN
 
 #if MPT_COMPILER_GCC
 #if MPT_GCC_AT_LEAST(4,8,0)
-#define bswap16 __builtin_bswap16
+#define MPT_bswap16 __builtin_bswap16
 #endif
 #if MPT_GCC_AT_LEAST(4,3,0)
 #define MPT_bswap32 __builtin_bswap32
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

manx

manx

2015-11-06 12:06

administrator   ~0002169

Oops, obvious typo. Thanks for the report. Fixed in r5736.

Issue History

Date Modified Username Field Change
2015-11-06 11:29 wiz New Issue
2015-11-06 11:29 wiz File Added: patch-common_Endianness.h.diff
2015-11-06 12:06 manx Note Added: 0002169
2015-11-06 12:06 manx Status new => resolved
2015-11-06 12:06 manx Fixed in Version => OpenMPT 1.25.03.* (old testing)
2015-11-06 12:06 manx Resolution open => fixed
2015-11-06 12:06 manx Assigned To => manx