Opened 16 years ago

Closed 16 years ago

#4271 closed patch (fixed)

Legacy, implicit casts etc

Reported by: andrei@… Owned by: danielk
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

The attached patch fixes some issues that cropped up during porting to MinGW: bzero has been declared as "legacy": replace with memset. Result of dlopen/dlsym is compared to NULL, instead of relying on dlopen(). others are related to using intrinsic datatypes, variable names reserved as type names, implicit casts that don't always work (e.g. pthread_t is not necessarily a pointer on all platforms).

Attachments (1)

legacy.patch (14.6 KB) - added by andrei@… 16 years ago.

Download all attachments as: .zip

Change History (7)

Changed 16 years ago by andrei@…

Attachment: legacy.patch added

comment:1 Changed 16 years ago by danielk

Owner: changed from Isaac Richards to danielk
Priority: majorminor
Severity: mediumlow

comment:2 Changed 16 years ago by danielk

Please look at libavformat/utils.c parse_date, using the non-threadsafe version of gmtime_r() and localtime_r is not acceptable. But you can create emulation wrappers for MS Windows and stick them in a "compat.h" header.

There was no apparent need for the programs/mythfrontend/globalsettings.cpp, or dvdnav changes so I dropped them.

dlfcn.h is needed on real POSIX systems in filtermanager.cpp, if it doesn't exist on MS Windows, it should be protected with an #ifdef

-- I'll commit the other changes as soon as I've finished some testing.

comment:3 Changed 16 years ago by danielk

Resolution: fixed
Status: newclosed

(In [15060]) Fixes #4271. Various POSIX compatibility fixes for Windows port.

comment:4 Changed 16 years ago by andrei@…

Resolution: fixed
Status: closedreopened

globalsettings.cpp: grp1 is used as a standard resource ID when windows.h is included, instead of #undef'ing it I just renamed the local variable.

dvdnav: uint is not defined in MinGW, I didn't want to litter the files with #ifdef's and #define's, replaced with uint32_t

I can find a different workaround for both issues, but I would prefer to do it this way.

comment:5 Changed 16 years ago by danielk

The globalsettings.cpp variable rename is fine, I just thought it was chaff because I didn't know about the windows.h define.

For uint, I can add it to compat.h, there was already such a typedef in my own compat.h, but I didn't think it was needed for MythTV because <types.h> has uint.

Minimizing #ifdef's is an important goal.

comment:6 Changed 16 years ago by danielk

Resolution: fixed
Status: reopenedclosed

(In [15121]) Fixes #4271. Adds compat.h to dvdnav so it compiles under MinGW.

Note: See TracTickets for help on using tickets.