Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems building libshout from the source with MinGW/MSys

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
LRN



Joined: 17 Jun 2009
Posts: 1

PostPosted: Wed Jun 17, 2009 8:56 am    Post subject: Problems building libshout from the source with MinGW/MSys Reply with quote

1) libshout uses general _WIN32 preprocessor check, but assumes that it means Microsoft's cl.exe compiler - that it not true. Only the presence of _MSC_VER points to that, _WIN32 may be (and is) defined by MinGW, which (being C99- and *nix-compatible) does not need some of the definitions that libshout does for cl.exe

2) grep-based automake version check is made for old "automake (GNU automake) 1.x", and it thinks that "automake (GNU automake) 1.10" to be 1.1, not 1.10

3) there is no sleep() function in MinGW, only _sleep() (considered to be deprecated, on Windows one should use native Sleep() function) and usleep() (same thing, but takes microseconds), but nonblocking example requires sleep() to be present

A patch to fix all three:
Code:

Index: include/os.h
===================================================================
--- include/os.h   (revision 16141)
+++ include/os.h   (working copy)
@@ -1,4 +1,4 @@
-#ifdef _WIN32
+#ifdef _MSC_VER
 typedef __int64 int64_t;
 typedef unsigned __int64 uint64_t;
 typedef unsigned __int32 uint32_t;
Index: src/shout.c
===================================================================
--- src/shout.c   (revision 16141)
+++ src/shout.c   (working copy)
@@ -38,7 +38,7 @@
 #include "shout_private.h"
 #include "util.h"
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 # ifndef va_copy
 #  define va_copy(ap1, ap2) memcpy(&ap1, &ap2, sizeof(va_list))
 # endif
Index: autogen.sh
===================================================================
--- autogen.sh   (revision 16141)
+++ autogen.sh   (working copy)
@@ -18,7 +18,7 @@
         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
         DIE=1
 }
-VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
+VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9][0-9]\).*/\1/"
                                                                                 
 # do we need automake?
 if test -r Makefile.am; then
Index: examples/nonblocking.c
===================================================================
--- examples/nonblocking.c   (revision 16141)
+++ examples/nonblocking.c   (working copy)
@@ -68,7 +68,7 @@
 
    while (ret == SHOUTERR_BUSY) {
      printf("Connection pending. Sleeping...\n");
-     sleep(1);
+     usleep(1000000);
      ret = shout_get_connected(shout);
    }
    
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber