[mythtv] [mythtv-commits] mythtv commit: r21606 - in trunk/mythtv by markk

Jonathan Martens jonathan at snetram.nl
Mon Aug 31 18:32:01 UTC 2009


On 31-8-2009 19:57, Jonathan Martens wrote:
> On 31-8-2009 19:45, Daniel Kristjansson wrote:
>> AFAICT these are due to compat.h not being included in mythsocket.h
>>
>> I've fixed a couple of these in [21611] by getting replacing bzero
>> with memset, which is available on all platforms.
>>
>> compat.h should never have been included in mythsocket.h, nor really
>> in any other header file. This is especially true of header files
>> exported for plugins.
>>
>> You can fix header files by extracting just the bit needed from
>> compat.h for that header file, cpp files that depended on
>> mythsocket.h including compat.h can explicitly include it.
>
> I will try 21611+ to see what it brings and mess around with the headers
> abit to see what I can fix.

To fix this one:

g++ -c -march=pentium4 -fomit-frame-pointer -O3 -DNDEBUG -g -Wall 
-Wno-switch -W
pointer-arith -Wredundant-decls -Wno-non-virtual-dtor -funit-at-a-time 
-D__STDC_
CONSTANT_MACROS -frtti -fexceptions -mthreads -DQT_LARGEFILE_SUPPORT 
-DWIN32 -DU
SING_MINGW -DUSING_WINAUDIO -DUSING_D3D -DMMX -Di386 -DUSING_DIRECTX 
-D_GNU_SOUR
CE -D_FILE_OFFSET_BITS=64 -DRUNPREFIX=\"..\" -DLIBDIRNAME=\"lib\" 
-DQT_THREAD_SU
PPORT -DQT_DLL -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB 
-I'../..
/../../Qt/4.5.2/include/QtCore' 
-I'../../../../Qt/4.5.2/include/QtNetwork' -I'..
/../../../Qt/4.5.2/include/QtGui' -I'../../../../Qt/4.5.2/include/QtSql' 
-I'../.
./../../Qt/4.5.2/include' -I'/usr/include' -I'../../../build' 
-I'../../../../Qt/
4.5.2/include/ActiveQt' -I'.' -I'../../../../qt/4.5.2/mkspecs/win32-g++' 
-o myth
socket.o mythsocket.cpp
mythsocket.cpp: In member function 'bool 
MythSocket::readStringList(QStringList&
, uint)':
mythsocket.cpp:497: error: aggregate 'timeval tv' has incomplete type 
and cannot
  be defined
mythsocket.cpp:499: error: 'fd_set' was not declared in this scope
mythsocket.cpp:499: error: expected `;' before 'rfds'
mythsocket.cpp:501: error: 'rfds' was not declared in this scope
mythsocket.cpp:501: error: 'FD_ZERO' was not declared in this scope
mythsocket.cpp:502: error: 'FD_SET' was not declared in this scope
mythsocket.cpp:508: error: 'select' was not declared in this scope
make[2]: *** [mythsocket.o] Error 1
make[2]: Leaving directory `/u/mythtv/mythtv/libs/libmythdb'
make[1]: *** [sub-libmythdb-make_default] Error 2
make[1]: Leaving directory `/u/mythtv/mythtv/libs'
make: *** [sub-libs-make_default-ordered] Error 2

We need something like this:

#ifdef USING_MINGW
#include <winsock.h>
#endif

but after that I still have this error:

g++ -c -march=pentium4 -fomit-frame-pointer -O3 -DNDEBUG -g -Wall 
-Wno-switch -W
pointer-arith -Wredundant-decls -Wno-non-virtual-dtor -funit-at-a-time 
-D__STDC_
CONSTANT_MACROS -frtti -fexceptions -mthreads -DQT_LARGEFILE_SUPPORT 
-DWIN32 -DU
SING_MINGW -DUSING_WINAUDIO -DUSING_D3D -DMMX -Di386 -DUSING_DIRECTX 
-D_GNU_SOUR
CE -D_FILE_OFFSET_BITS=64 -DRUNPREFIX=\"..\" -DLIBDIRNAME=\"lib\" 
-DQT_THREAD_SU
PPORT -DQT_DLL -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB 
-I'../..
/../../Qt/4.5.2/include/QtCore' 
-I'../../../../Qt/4.5.2/include/QtNetwork' -I'..
/../../../Qt/4.5.2/include/QtGui' -I'../../../../Qt/4.5.2/include/QtSql' 
-I'../.
./../../Qt/4.5.2/include' -I'/usr/include' -I'../../../build' 
-I'../../../../Qt/
4.5.2/include/ActiveQt' -I'.' -I'../../../../qt/4.5.2/mkspecs/win32-g++' 
-o myth
socketthread.o mythsocketthread.cpp
mythsocketthread.cpp: In member function 'virtual void 
MythSocketThread::run()':
mythsocketthread.cpp:222: warning: comparison between signed and 
unsigned intege
r expressions
mythsocketthread.cpp:246: error: 'O_NONBLOCK' was not declared in this scope
mythsocketthread.cpp:249: warning: comparison between signed and 
unsigned intege
r expressions
make[2]: *** [mythsocketthread.o] Error 1
make[2]: Leaving directory `/u/mythtv/mythtv/libs/libmythdb'
make[1]: *** [sub-libmythdb-make_default] Error 2
make[1]: Leaving directory `/u/mythtv/mythtv/libs'
make: *** [sub-libs-make_default-ordered] Error 2

Off which the warnings can be taken away bu including winsock.h instead 
of winsock2.h in mythsocketthread.h (not sure why you choose winsock2.h 
over winsock.h though).

But that still leaves this O_NONBLOCK which seems to be defined by 
fnctl.h on *nix, but is unavailable on MinGW installations:

g++ -c -march=pentium4 -fomit-frame-pointer -O3 -DNDEBUG -g -Wall 
-Wno-switch -W
pointer-arith -Wredundant-decls -Wno-non-virtual-dtor -funit-at-a-time 
-D__STDC_
CONSTANT_MACROS -frtti -fexceptions -mthreads -DQT_LARGEFILE_SUPPORT 
-DWIN32 -DU
SING_MINGW -DUSING_WINAUDIO -DUSING_D3D -DMMX -Di386 -DUSING_DIRECTX 
-D_GNU_SOUR
CE -D_FILE_OFFSET_BITS=64 -DRUNPREFIX=\"..\" -DLIBDIRNAME=\"lib\" 
-DQT_THREAD_SU
PPORT -DQT_DLL -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB 
-I'../..
/../../Qt/4.5.2/include/QtCore' 
-I'../../../../Qt/4.5.2/include/QtNetwork' -I'..
/../../../Qt/4.5.2/include/QtGui' -I'../../../../Qt/4.5.2/include/QtSql' 
-I'../.
./../../Qt/4.5.2/include' -I'/usr/include' -I'../../../build' 
-I'../../../../Qt/
4.5.2/include/ActiveQt' -I'.' -I'../../../../qt/4.5.2/mkspecs/win32-g++' 
-o myth
socketthread.o mythsocketthread.cpp
mythsocketthread.cpp: In member function 'virtual void 
MythSocketThread::run()':
mythsocketthread.cpp:247: error: 'O_NONBLOCK' was not declared in this scope
make: *** [mythsocketthread.o] Error 1

Quickly grepping on my CentOS 5.3 machines and a manual define brings me 
to the attached patch, which seems to make libmythdb compile again on 
Windows as of r21612.

Not sure if the defined value of O_NONBLOCK really is correct, so please 
verify. All needed changes are summarized in attached patch, I am still 
building so I have not had the time to test.

Kind regards,

Jonathan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 6516-fix-windows-compilation-after-r21611.patch
URL: <http://mythtv.org/pipermail/mythtv-dev/attachments/20090831/599219f8/attachment.asc>


More information about the mythtv-dev mailing list