--- mcpp-2.7.2.orig/src/main.c +++ mcpp-2.7.2/src/main.c @@ -326,6 +326,8 @@ = FALSE; option_flags.trig = TRIGRAPHS_INIT; option_flags.dig = DIGRAPHS_INIT; + sh_file = NULL; + sh_line = 0; } int mcpp_lib_main --- mcpp-2.7.2.orig/src/internal.H +++ mcpp-2.7.2/src/internal.H @@ -390,6 +390,8 @@ extern char identifier[]; /* Lastly scanned name */ extern IFINFO ifstack[]; /* Information of #if nesting */ extern char work_buf[]; +extern FILEINFO * sh_file; +extern int sh_line; /* Temporary buffer for directive line and macro expansion */ /* main.c */ @@ -557,6 +559,6 @@ #endif #endif -#if HOST_HAVE_STPCPY +#if HOST_HAVE_STPCPY && !defined(stpcpy) extern char * stpcpy( char * dest, const char * src); #endif --- mcpp-2.7.2.orig/src/support.c +++ mcpp-2.7.2/src/support.c @@ -188,7 +188,7 @@ size_t length ) { - if (mem_buf_p->bytes_avail < length) { /* Need to allocate more memory */ + if (mem_buf_p->bytes_avail < length + 1) { /* Need to allocate more memory */ size_t size = MAX( BUF_INCR_SIZE, length); if (mem_buf_p->buffer == NULL) { /* 1st append */ @@ -1722,6 +1722,8 @@ sp -= 2; while (*sp != '\n') /* Until end of line */ mcpp_fputc( *sp++, OUT); + mcpp_fputc( '\n', OUT); + wrong_line = TRUE; } goto end_line; default: /* Not a comment */ --- mcpp-2.7.2.orig/src/system.c +++ mcpp-2.7.2/src/system.c @@ -3858,6 +3858,9 @@ } #endif +FILEINFO* sh_file; +int sh_line; + void sharp( FILEINFO * sharp_file, int flag /* Flag to append to the line for GCC */ @@ -3868,8 +3871,6 @@ * else (i.e. 'sharp_file' is NULL) 'infile'. */ { - static FILEINFO * sh_file; - static int sh_line; FILEINFO * file; int line; --- mcpp-2.7.2.orig/debian/libmcpp-dev.install +++ mcpp-2.7.2/debian/libmcpp-dev.install @@ -0,0 +1,4 @@ +debian/tmp/usr/include/*.h +debian/tmp/usr/lib/lib*.a +debian/tmp/usr/lib/lib*.la +debian/tmp/usr/lib/lib*.so --- mcpp-2.7.2.orig/debian/README.Debian +++ mcpp-2.7.2/debian/README.Debian @@ -0,0 +1,7 @@ +mcpp for Debian +--------------- + +This is a package made by the author of mcpp himself, referring to the +forerunning Debian's package made by NIIBE Yutaka. + + -- Kiyoshi Matsui , Sat, 07 Apr 2007 14:27:29 +0900 --- mcpp-2.7.2.orig/debian/watch +++ mcpp-2.7.2/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://sf.net/mcpp/mcpp-(.*)\.tar\.gz --- mcpp-2.7.2.orig/debian/copyright +++ mcpp-2.7.2/debian/copyright @@ -0,0 +1,68 @@ +This package was debianized by Kiyoshi Matsui on +Mon, 24 Mar 2008 00:49:32 +0900 + +It was downloaded from + +Copyright Holder: Kiyoshi Matsui + +License: +(Taken from mcpp-2.7/LICENSE) +/*- + * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui + * All rights reserved. + * + * This software including the files in this directory is provided under + * the following license. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +ZeroC patch license: + +/*- + * Copyright (c) 2010 ZeroC, Inc. + * All rights reserved. + * + * This software including the files in this directory is provided under + * the following license. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ --- mcpp-2.7.2.orig/debian/docs +++ mcpp-2.7.2/debian/docs @@ -0,0 +1,2 @@ +README +NEWS --- mcpp-2.7.2.orig/debian/libmcpp-dev.dirs +++ mcpp-2.7.2/debian/libmcpp-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include --- mcpp-2.7.2.orig/debian/libmcpp0.dirs +++ mcpp-2.7.2/debian/libmcpp0.dirs @@ -0,0 +1 @@ +usr/lib --- mcpp-2.7.2.orig/debian/compat +++ mcpp-2.7.2/debian/compat @@ -0,0 +1 @@ +5 --- mcpp-2.7.2.orig/debian/mcpp.install +++ mcpp-2.7.2/debian/mcpp.install @@ -0,0 +1,2 @@ +debian/tmp/usr/bin/* +debian/tmp/usr/share/man/* --- mcpp-2.7.2.orig/debian/dirs +++ mcpp-2.7.2/debian/dirs @@ -0,0 +1 @@ +usr/bin --- mcpp-2.7.2.orig/debian/changelog +++ mcpp-2.7.2/debian/changelog @@ -0,0 +1,120 @@ +mcpp (2.7.2-1.1) unstable; urgency=low + + * Non-maintainer upload. + + -- Cleto Martin Angelina Tue, 01 Feb 2011 12:38:46 +0100 + +mcpp (2.7.2-1) unstable; urgency=low + + * New upstream release. + + -- Kiyoshi Matsui Wed, 10 Feb 2010 10:15:10 +0900 + +mcpp (2.7.1) unstable; urgency=low + + * New upstream release. + + -- Kiyoshi Matsui Sat, 24 May 2008 18:40:22 +0900 + +mcpp (2.7-3) unstable; urgency=low + + * Provide mcpp-doc package as well. Thanks to 2.6.4-2ubuntu1 package. + + -- Kiyoshi Matsui Mon, 07 Apr 2008 18:08:47 +0900 + +mcpp (2.7-2) unstable; urgency=low + + * debian/control, debian/rules: Provide packages libmcpp0 and + libmcpp0-dev as well as mcpp (Closes: #474169). + Thanks to Francisco Moya. + * debian/copyright: Updated. + + NIIBE Yutaka: + * src/Makefile.am: Build mcpp with libmcpp. + * src/main_libmcpp.c: New file. + * Makefile.am: Install mcpp.1 even if MCPP_LIB is defined. + * debian/libmcpp-dev.{dirs,install}, debian/libmcpp0.{dirs,install}, + debian/mcpp.install: New files. + * debian/rules: Enable dh_install and dh_makeshlibs. + Supply ac_cv_func_stpcpy=no to configure option to avoid GCC bug. + + -- Kiyoshi Matsui Sat, 05 Apr 2008 23:21:59 +0900 + +mcpp (2.7-1) unstable; urgency=low + + * New upstream release. + + -- NIIBE Yutaka Fri, 28 Mar 2008 11:07:36 +0900 + +mcpp (2.6.4-2) unstable; urgency=low + + * Applied a patch of 1796222 at sf.net. + * debian/control (Standards-Version): It now follows 3.7.3. + * debian/rules (clean): Fix distclean. + (install): Remove empty /usr/lib. + + -- NIIBE Yutaka Fri, 25 Jan 2008 09:35:00 +0900 + +mcpp (2.6.4-1) unstable; urgency=low + + * New upstream release. + + -- Kiyoshi Matsui Sun, 20 May 2007 22:55:19 +0900 + +mcpp (2.6.3-1) unstable; urgency=low + + * Initial Release by the author of mcpp. + + -- Kiyoshi Matsui Sat, 07 Apr 2007 14:27:29 +0900 + +mcpp (2.6.2-1) unstable; urgency=low + + * New upstream release. + + -- NIIBE Yutaka Mon, 13 Nov 2006 16:31:58 +0900 + +mcpp (2.6.1-2) unstable; urgency=low + + * configure.ac: Revert the change for automake 1.9 to minimize diff. + (The fix has been reported to upstream and it will be included in + forthcoming next release.) + + -- NIIBE Yutaka Sat, 21 Oct 2006 14:38:24 +0900 + +mcpp (2.6.1-1) unstable; urgency=low + + * configure.ac: Fix for automake 1.9. + * debian/rules: Install the manual. + * debian/control (Standards-Version): Follows new standard 3.7.2.2. + * debian/watch: The upstram has been moved. + * New upstream release + + -- NIIBE Yutaka Sat, 14 Oct 2006 15:25:32 +0900 + +mcpp (2.5-1) unstable; urgency=low + + * New upstream release + + -- NIIBE Yutaka Sat, 16 Apr 2005 15:58:16 +0900 + +mcpp (2.4.1-3) unstable; urgency=low + + * debian/control: Improve Description. + * debian/watch: Prepend opts=pasv before URL. + + -- NIIBE Yutaka Sat, 23 Oct 2004 23:18:57 +0900 + +mcpp (2.4.1-2) unstable; urgency=low + + * src/mcpp.1: Fix formatting. + + -- NIIBE Yutaka Mon, 9 Aug 2004 17:21:10 +0900 + +mcpp (2.4.1-1) unstable; urgency=low + + * Initial Release. + config/config.guess, config/config.sub: Import up-to-date version. + src/mcpp.1: Added. + closes: Bug#239704 + + -- NIIBE Yutaka Mon, 2 Aug 2004 22:04:32 +0900 --- mcpp-2.7.2.orig/debian/control +++ mcpp-2.7.2/debian/control @@ -0,0 +1,48 @@ +Source: mcpp +Section: devel +Priority: optional +Maintainer: Kiyoshi Matsui +Uploaders: NIIBE Yutaka +Build-Depends: debhelper (>= 5) +Standards-Version: 3.9.1 +DM-Upload-Allowed: yes + +Package: mcpp +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Suggests: mcpp-doc +Description: Alternative C/C++ preprocessor + C/C++ preprocessor defines and expands macros and processes '#if', + '#include' and some other directives. + . + mcpp is an alternative C/C++ preprocessor with the highest conformance. + It supports multiple standards: K&R, ISO C90, ISO C99, and ISO C++98. + mcpp is especially useful for debugging a source program which uses + complicated macros and also useful for checking portability of a source. + . + Though mcpp could be built as a replacement of GCC's resident + proprocessor or as a stand-alone program without using library build of + mcpp, this package installs only a program named 'mcpp' which links + shared library of mcpp and behaves independent from GCC. + +Package: libmcpp0 +Section: libs +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: Alternative C/C++ preprocessor (shared library) + This package installs the shared library version of mcpp. + +Package: libmcpp-dev +Section: libdevel +Architecture: any +Depends: ${misc:Depends}, libmcpp0 (= ${binary:Version}) +Description: Alternative C/C++ preprocessor (development files) + This package installs the development files for the library version + of mcpp. + +Package: mcpp-doc +Architecture: all +Section: doc +Depends: ${misc:Depends} +Description: Alternative C/C++ preprocessor (manual) + This package contains the manual. --- mcpp-2.7.2.orig/debian/libmcpp0.install +++ mcpp-2.7.2/debian/libmcpp0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/lib*.so.* --- mcpp-2.7.2.orig/debian/rules +++ mcpp-2.7.2/debian/rules @@ -0,0 +1,104 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Based on template: GNU copyright 1997 to 1999 by Joey Hess. + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +config.status: configure + dh_testdir + ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-mcpplib CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" + + +build: build-stamp +build-stamp: config.status + dh_testdir + $(MAKE) + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + [ ! -f Makefile ] || $(MAKE) distclean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install +# LICENSE is included in debian/copyright + rm -f $(CURDIR)/debian/tmp/usr/share/doc/mcpp/LICENSE + + mkdir -p debian/mcpp-doc/usr/share/doc/mcpp + mkdir -p debian/mcpp-doc/usr/share/doc/mcpp-doc + mv debian/tmp/usr/share/doc/mcpp/*.html \ + debian/mcpp-doc/usr/share/doc/mcpp/ + for i in debian/mcpp-doc/usr/share/doc/mcpp/*.html; do \ + i=$$(basename $$i); \ + dh_link -pmcpp-doc \ + /usr/share/doc/mcpp/$$i /usr/share/doc/mcpp-doc/$$i; \ + done + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol -pmcpp-doc + dh_md5sums -pmcpp-doc + dh_builddeb -pmcpp-doc + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol -pmcpp -plibmcpp0 -plibmcpp-dev + dh_md5sums -pmcpp -plibmcpp0 -plibmcpp-dev + dh_builddeb -pmcpp -plibmcpp0 -plibmcpp-dev + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install