yanivnizry / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Unused struct in mongoose-3.1.c, which is conflict with some sys/types.h. #338

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download mongoose-3.1 in "Downloads".
2. Install mingw-w64 4.6.1 in Ubuntu 11.10.
3. Execute following commands:

#!/bin/bash

HOST=i686-w64-mingw32
CC=${HOST}-gcc
CXX=${HOST}-g++
AR=${HOST}-ar
RC=${HOST}-windres
RANLIB=${HOST}-ranlib
STRIP=${HOST}-strip

cd mongoose
make clean
PROG="mongoose"
MINGWDBG="-DNDEBUG -Os"
#MINGWOPT= -W -Wall -mthreads -Wl,--subsystem,console $(MINGWDBG) -DHAVE_STDINT
MINGWOPT="-W -Wall -mthreads -Wl,--subsystem,windows ${MINGWDBG}"

${RC} win32/res.rc win32/res.o
${CC} ${MINGWOPT} mongoose.c -lws2_32 \
    -shared -Wl,--out-implib=lib${PROG}.a -o ${PROG}.dll
${CC} ${MINGWOPT} mongoose.c main.c win32/res.o -lws2_32 -ladvapi32 \
    -o ${PROG}.exe

What is the expected output? What do you see instead?

Error output by i686-w64-mingw32-gcc:

mongoose.c:140:8: 错误: ‘struct timespec’重定义
/usr/lib/gcc/i686-w64-mingw32/4.6.1/../../../../i686-w64-mingw32/include/sys/typ
es.h:108:8: 附注: 原先在这里定义

( P.S. I use Chinese operating system. The message means that here is a struct 
named "timespec" conflicting with /usr/i686-w64-mingw32/include/sys/types.h )

And here was no dll or exe generated.

Please provide any additional information below.

I examined mongoose.c, and found out that nothing uses this structure. So I 
simply deleted these codes around line 140, then compiled again. This time, I 
saw libmongoose.dll and mongoose.exe.

Original issue reported on code.google.com by air...@gmail.com on 31 Mar 2012 at 1:01

GoogleCodeExporter commented 8 years ago
Pushed 771ce90, thanks

Original comment by valenok on 22 Sep 2012 at 12:36