Issue 20975 - malloc.h on FreeBSD has been replaced by stdlib.h
Summary: malloc.h on FreeBSD has been replaced by stdlib.h
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: OOo 1.1
Hardware: PC FreeBSD
: P3 Trivial (vote)
Target Milestone: OOo 1.1.1
Assignee: Martin Hollmichel
QA Contact: issues@porting
URL:
Keywords:
Depends on:
Blocks: 18060
  Show dependency tree
 
Reported: 2003-10-09 20:27 UTC by pavel
Modified: 2003-12-20 22:11 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Do not include malloc.h on FreeBSD (912 bytes, patch)
2003-10-10 13:53 UTC, pavel
no flags Details | Diff
FInal patch for inclusion (1.22 KB, patch)
2003-10-13 17:12 UTC, pavel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description pavel 2003-10-09 20:27:55 UTC
Hi,

1.1.0 compilation of FreeBSD 5.1:

Making: ../../unxfbsd.pro/slo/typelib.obj
/home/pavel//BuildDir/ccache /usr/bin/g++ -w -c -I.  -I. -I../inc -I../../inc -I
../../unx/inc -I../../unxfbsd.pro/inc -I. -I/usr/home/pavel/BuildDir/ooo_1.1.0_s
rc/solver/645/unxfbsd.pro/inc/stl -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solve
r/645/unxfbsd.pro/inc/external -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solver/6
45/unxfbsd.pro/inc -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solenv/unxfbsd/inc -
I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solenv/inc -I/usr/home/pavel/BuildDir/oo
o_1.1.0_src/res -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solver/645/unxfbsd.pro/
inc/stl -I/usr/home/pavel/BuildDir/ooo_1.1.0_src/solenv/inc/Xp31 -I/usr/local/jd
k1.3.1/include -I/usr/local/jdk1.3.1/include/freebsd -I/usr/local/jdk1.3.1/inclu
de/bsd -I/usr/local/jdk1.3.1/include/native_threads/include -I/usr/X11R6/include
     -I. -I../../res -I. -I/usr/X11R6/include -O   -O -DCPPU_LEAK_STATIC_DATA -p
ipe -fno-for-scope -fpermissive -fno-rtti -fexceptions   -fPIC -DFREEBSD -DUNX -
DVCL -DGCC -DC300 -DINTEL -DCVER=C300 -D_USE_NAMESPACE -D_USE_NAMESPACE=1 -DX86 
-DNEW_SOLAR -DSTLPORT_VERSION=450 -DOSVERSION= -D_THREAD_SAFE -D_REENTRANT -D__D
MAKE -DUNIX -DCPPU_ENV=gcc3 -DSUPD=645 -DBUILD=8693 -DPRODUCT -DNDEBUG -DPRODUCT
_FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DEXCEPTIONS_ON -DCUI -DSOLAR_JAVA -DSRX645
  -DSHAREDLIB -D_DLL_  -DMULTITHREAD  -w -o ../../unxfbsd.pro/slo/typelib.o /usr
/home/pavel/BuildDir/ooo_1.1.0_src/cppu/source/typelib/typelib.cxx
In file included from /usr/home/pavel/BuildDir/ooo_1.1.0_src/cppu/source/typelib
/typelib.cxx:72:
/usr/include/malloc.h:3:2: #error "<malloc.h> has been replaced by <stdlib.h>"
dmake:  Error code 1, while making '../../unxfbsd.pro/slo/typelib.obj'
Comment 1 pavel 2003-10-10 07:19:34 UTC
the same applies to stoc/source/corereflection/criface.cxx
Comment 2 pavel 2003-10-10 13:41:03 UTC
This is generic problem thus probably should be in porting.
Comment 3 pavel 2003-10-10 13:41:30 UTC
Reasing the owner to porting too.
Comment 4 pavel 2003-10-10 13:52:28 UTC
ports on FreeBSD solve it by running throuhg all sources and replacing
malloc.h for stdlib.h -> nonsense, because stdlib.h is almost
certainly included before. Thus I propose the attached patch.

I'd like to hear from FreeBSD folks, if it is OK.

I didn't finished the build yet, thus only those two files are covered
by this patch.
Comment 5 pavel 2003-10-10 13:53:18 UTC
Created attachment 10188 [details]
Do not include malloc.h on FreeBSD
Comment 6 pavel 2003-10-13 17:11:30 UTC
The build finished, the complete patch attached.
Comment 7 pavel 2003-10-13 17:12:06 UTC
Created attachment 10274 [details]
FInal patch for inclusion
Comment 8 fa 2003-10-13 18:42:12 UTC
Approved for inclusion in 1.1.1.
Comment 9 pavel 2003-10-13 19:47:45 UTC
Fixed in cws_srx645_ooo111fix1.

Comment 10 maho.nakata 2003-10-22 00:15:32 UTC
comment for this issue:
In the ports framework, we do:

@${ECHO_MSG} "===>  Find old malloc.h defines and fix them in ${PKGNAME}
 source"
        @${FIND} ${WRKSRC}/.. | ${EGREP} "\.(cxx|h|c)$$" | ${XARGS} \
                ${PERL} -pi -e "s|<malloc.h>|<stdlib.h>|g"
Comment 11 pavel 2003-10-22 06:32:38 UTC
Maho, this is of course non-sense as I wrote in the comment above you
comment. Please read it again.
Comment 12 maho.nakata 2003-10-22 08:25:54 UTC
pointy hat to: myself
thanks, pavel
Comment 13 pavel 2003-12-20 22:11:25 UTC
Verified, closing.