After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 575373 - make totem-plparser buildable with msvc
make totem-plparser buildable with msvc
Status: RESOLVED FIXED
Product: totem-pl-parser
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: totem-pl-parser-maint
totem-pl-parser-maint
Depends on:
Blocks:
 
 
Reported: 2009-03-14 17:42 UTC by Shixin Zeng
Modified: 2010-04-20 20:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build fixes to the library itself (3.30 KB, patch)
2009-03-14 17:43 UTC, Shixin Zeng
needs-work Details | Review
build fixes to the test-parser (903 bytes, patch)
2009-03-14 17:44 UTC, Shixin Zeng
none Details | Review
build fixes to the test-parser (962 bytes, patch)
2009-03-14 17:50 UTC, Shixin Zeng
needs-work Details | Review
build fixes for msvc (3.30 KB, patch)
2010-03-30 22:13 UTC, Shixin Zeng
none Details | Review
C89 fix (852 bytes, patch)
2010-03-30 22:15 UTC, Shixin Zeng
committed Details | Review
include unistd.h conditionally (1.57 KB, patch)
2010-03-30 22:15 UTC, Shixin Zeng
committed Details | Review
fix includes for msvc (637 bytes, patch)
2010-04-19 22:31 UTC, Shixin Zeng
committed Details | Review
rename macro __MINGW32__ to _WIN32 to make it work with msvc (1.29 KB, patch)
2010-04-19 22:32 UTC, Shixin Zeng
committed Details | Review
utilize the variadic macro support in msvc newer than VS8 (1.09 KB, patch)
2010-04-19 22:32 UTC, Shixin Zeng
committed Details | Review
add an S_ISBLK macro definition for msvc (824 bytes, patch)
2010-04-19 22:33 UTC, Shixin Zeng
needs-work Details | Review
remove the unneeded unistd.h and fix compatibility for msvc (823 bytes, patch)
2010-04-19 22:33 UTC, Shixin Zeng
committed Details | Review
check for block devices only on non-win32 systems (965 bytes, patch)
2010-04-20 20:46 UTC, Shixin Zeng
committed Details | Review

Description Shixin Zeng 2009-03-14 17:42:19 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:
Comment 1 Shixin Zeng 2009-03-14 17:43:39 UTC
Created attachment 130672 [details] [review]
build fixes to the library itself
Comment 2 Shixin Zeng 2009-03-14 17:44:12 UTC
Created attachment 130673 [details] [review]
build fixes to the test-parser
Comment 3 Shixin Zeng 2009-03-14 17:50:59 UTC
Created attachment 130674 [details] [review]
build fixes to the test-parser
Comment 4 Bastien Nocera 2009-03-31 12:18:16 UTC
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 5 Bastien Nocera 2009-03-31 12:19:23 UTC
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?
Comment 6 Shixin Zeng 2009-03-31 17:33:08 UTC
(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.
Comment 7 Bastien Nocera 2009-03-31 19:16:39 UTC
I'm not sure that'll help, I'll still need to see the patches posted here...
Comment 8 Shixin Zeng 2009-03-31 19:41:13 UTC
(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.
Comment 9 Shixin Zeng 2009-03-31 20:53:45 UTC
(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.
Comment 10 Bastien Nocera 2009-06-17 10:55:03 UTC
Could you please update your patches? Now is the time to get them in...
Comment 11 Akhil Laddha 2009-12-18 06:09:03 UTC
Shixin, ping, did you get time to update the patches ?
Comment 12 Shixin Zeng 2009-12-24 09:35:19 UTC
(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.
Comment 13 Tobias Mueller 2010-03-29 17:14:22 UTC
Shixin, any news? :)
Comment 14 Shixin Zeng 2010-03-30 22:13:38 UTC
Created attachment 157534 [details] [review]
build fixes for msvc
Comment 15 Shixin Zeng 2010-03-30 22:14:51 UTC
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? :)
Comment 16 Shixin Zeng 2010-03-30 22:15:20 UTC
Created attachment 157535 [details] [review]
C89 fix
Comment 17 Shixin Zeng 2010-03-30 22:15:47 UTC
Created attachment 157536 [details] [review]
include unistd.h conditionally
Comment 18 Tobias Mueller 2010-03-30 23:50:18 UTC
Reopening. Thanks Shixin! :)
Comment 19 Bastien Nocera 2010-04-12 12:12:38 UTC
Comment on attachment 157536 [details] [review]
include unistd.h conditionally

Committed minus the test changes.
Comment 20 Bastien Nocera 2010-04-12 12:29:44 UTC
Comment on attachment 157535 [details] [review]
C89 fix

Committed, and sent upstream:
http://thread.gmane.org/gmane.comp.video.xine.devel/18574
Comment 21 Bastien Nocera 2010-04-12 12:33:25 UTC
Any chance you could update and split up the patch in attachment 157534 [details] [review]?
Comment 22 Shixin Zeng 2010-04-19 22:31:29 UTC
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
Comment 23 Shixin Zeng 2010-04-19 22:32:06 UTC
Created attachment 159117 [details] [review]
rename macro __MINGW32__ to _WIN32 to make it work with msvc
Comment 24 Shixin Zeng 2010-04-19 22:32:35 UTC
Created attachment 159118 [details] [review]
utilize the variadic macro support in msvc newer than VS8
Comment 25 Shixin Zeng 2010-04-19 22:33:00 UTC
Created attachment 159119 [details] [review]
add an S_ISBLK macro definition for msvc
Comment 26 Shixin Zeng 2010-04-19 22:33:27 UTC
Created attachment 159120 [details] [review]
remove the unneeded unistd.h and fix compatibility for msvc
Comment 27 Bastien Nocera 2010-04-20 09:15:30 UTC
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
Comment 28 Bastien Nocera 2010-04-20 09:17:46 UTC
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.
Comment 29 Shixin Zeng 2010-04-20 20:46:30 UTC
Created attachment 159196 [details] [review]
check for block devices only on non-win32 systems
Comment 30 Bastien Nocera 2010-04-20 20:50:14 UTC
Attachment 159196 [details] pushed as e477455 - check for block devices only on non-win32 systems