GNOME Bugzilla – Bug 575373
make totem-plparser buildable with msvc
Last modified: 2010-04-20 20:50:17 UTC
Please describe the problem: The totem-plparser is already buildable with mingw on win32. But for those who want to use a native development environment, such as MSVC, it needs a little bit more work. Attached are the small patches to fix that. For those who want to try the patches, I have a git branch on http://github.com/zsx/totem-plparser/, follow the instructions on http://wiki.github.com/zsx/totem-plparser to build Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 130672 [details] [review] build fixes to the library itself
Created attachment 130673 [details] [review] build fixes to the test-parser
Created attachment 130674 [details] [review] build fixes to the test-parser
Comment on attachment 130672 [details] [review] build fixes to the library itself >diff --git a/lib/asprintf.c b/lib/asprintf.c >index da4e515..2484231 100644 >--- a/lib/asprintf.c >+++ b/lib/asprintf.c <snip> Is asprintf not available on Windows? >diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c >index 4645e2f..9ac7098 100644 >--- a/plparse/totem-pl-parser.c >+++ b/plparse/totem-pl-parser.c >@@ -131,6 +131,14 @@ > #include "totem-pl-parser-misc.h" > #include "totem-pl-parser-private.h" > >+#ifndef S_ISBLK >+ #ifndef S_IFBLK >+ #define S_ISBLK(m) (0) >+ #else >+ #define S_ISBLK(m) (((m) & S_IFMT)==S_IFBLK) >+ #endif /* S_IFBLK */ >+#endif /* S_ISBLK */ I'd rather the code that uses S_IFBLK be changed to detect Windows drive letters (such as "C:\") >diff --git a/plparse/xmlparser.c b/plparse/xmlparser.c >index 1697ec8..1ed871a 100644 >--- a/plparse/xmlparser.c >+++ b/plparse/xmlparser.c Changes here should be done upstream at xine-lib.
Comment on attachment 130674 [details] [review] build fixes to the test-parser The test-parser code move in trunk. Could you please update your patch?
(In reply to comment #5) > (From update of attachment 130674 [details] [review] [edit]) > The test-parser code move in trunk. Could you please update your patch? > I'm waiting for totem migration to Git.
I'm not sure that'll help, I'll still need to see the patches posted here...
(In reply to comment #7) > I'm not sure that'll help, I'll still need to see the patches posted here... > Surely I'll post the patches here. I'm waiting just because I did all this hacks on a local git branch, which was cloned from git://git.gnome.org/preview/totem-pl-parser. So migration to git will make it easier to update this patch.
(In reply to comment #4) > (From update of attachment 130672 [details] [review] [edit]) > >diff --git a/lib/asprintf.c b/lib/asprintf.c > >index da4e515..2484231 100644 > >--- a/lib/asprintf.c > >+++ b/lib/asprintf.c > <snip> > > Is asprintf not available on Windows? > I couldn't find it via MSDN, so I suppose it's missing on Windows.
Could you please update your patches? Now is the time to get them in...
Shixin, ping, did you get time to update the patches ?
(In reply to comment #11) > Shixin, ping, did you get time to update the patches ? Sorry, I'm on the vocation, and won't be back until early Jan. I'll try to find some time to work this one, if nobody beats on this.
Shixin, any news? :)
Created attachment 157534 [details] [review] build fixes for msvc
Sorry I don't have time to work on the patch, but the patches can be still applied to current master. I'm attaching them here. (In reply to comment #13) > Shixin, any news? :)
Created attachment 157535 [details] [review] C89 fix
Created attachment 157536 [details] [review] include unistd.h conditionally
Reopening. Thanks Shixin! :)
Comment on attachment 157536 [details] [review] include unistd.h conditionally Committed minus the test changes.
Comment on attachment 157535 [details] [review] C89 fix Committed, and sent upstream: http://thread.gmane.org/gmane.comp.video.xine.devel/18574
Any chance you could update and split up the patch in attachment 157534 [details] [review]?
Created attachment 159116 [details] [review] fix includes for msvc this is the first patch in a series patches that are splitted from the previous patch 157534
Created attachment 159117 [details] [review] rename macro __MINGW32__ to _WIN32 to make it work with msvc
Created attachment 159118 [details] [review] utilize the variadic macro support in msvc newer than VS8
Created attachment 159119 [details] [review] add an S_ISBLK macro definition for msvc
Created attachment 159120 [details] [review] remove the unneeded unistd.h and fix compatibility for msvc
Attachment 159116 [details] pushed as 30a4ecf - fix includes for msvc Attachment 159117 [details] pushed as 145f8d2 - rename macro __MINGW32__ to _WIN32 to make it work with msvc Attachment 159118 [details] pushed as a7d91e7 - utilize the variadic macro support in msvc newer than VS8
Review of attachment 159119 [details] [review]: I believe I already mentioned that I don't want to see a definition for S_ISBLK, as I'd rather that portion of the code be disabled on win32 instead.
Created attachment 159196 [details] [review] check for block devices only on non-win32 systems
Attachment 159196 [details] pushed as e477455 - check for block devices only on non-win32 systems