[Expat-checkins] CVS: expat/lib expat.h,1.13,1.14 Makefile.in,1.16,1.17 expat.dsp,1.5,1.6 xmlparse.c,1.22,1.23 expat.h.in,1.13,NONE

Greg Stein gstein@users.sourceforge.net
Thu, 23 Aug 2001 05:35:56 -0700


Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv8620/lib

Modified Files:
	Makefile.in expat.dsp xmlparse.c 
Added Files:
	expat.h 
Removed Files:
	expat.h.in 
Log Message:
Revamp how the version stuff is handled. Use the header file as the
original, and extract the numbers within the configure script.

* configure.in: extract the numbers from lib/expat.h

* Makefile.in: simplify the construction of DISTDIR

* lib/Makefile.in: no need to define the VERSION preprocessor symbol

* lib/expat.dsp: do not define VERSION (changed, but untested!)

* lib/xmlparse.c: revamp the XML_ExpatVersion() function

* lib/expat.h(.in): just ship the baby, rather than generating it




Index: Makefile.in
===================================================================
RCS file: /cvsroot/expat/expat/lib/Makefile.in,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Makefile.in	2001/08/23 09:24:45	1.16
--- Makefile.in	2001/08/23 12:35:53	1.17
***************
*** 34,38 ****
  CC = @CC@
  LIBTOOL = @LIBTOOL@
- VERSION = @VERSION@
  
  LIBRARY = libexpat.la
--- 34,37 ----
***************
*** 40,44 ****
  
  INCLUDES = -I$(srcdir) -I. -I..
! DEFS = @DEFS@ -DVERSION='"expat_$(VERSION)"'
  
  CPPFLAGS = @CPPFLAGS@
--- 39,43 ----
  
  INCLUDES = -I$(srcdir) -I. -I..
! DEFS = @DEFS@
  
  CPPFLAGS = @CPPFLAGS@

Index: expat.dsp
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.dsp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** expat.dsp	2001/07/27 14:56:31	1.5
--- expat.dsp	2001/08/23 12:35:53	1.6
***************
*** 97,105 ****
  !IF  "$(CFG)" == "expat - Win32 Release"
  
- # ADD CPP /D VERSION=\"expat_1.95.2\"
- 
  !ELSEIF  "$(CFG)" == "expat - Win32 Debug"
  
! # ADD CPP /GX- /Od /D VERSION=\"expat_1.95.2\"
  
  !ENDIF 
--- 97,103 ----
  !IF  "$(CFG)" == "expat - Win32 Release"
  
  !ELSEIF  "$(CFG)" == "expat - Win32 Debug"
  
! # ADD CPP /GX- /Od
  
  !ENDIF 
***************
*** 109,118 ****
  
  SOURCE=.\xmlrole.c
- # ADD CPP /D VERSION=\"expat_1.95.2\"
  # End Source File
  # Begin Source File
  
  SOURCE=.\xmltok.c
- # ADD CPP /D VERSION=\"expat_1.95.2\"
  # End Source File
  # End Group
--- 107,114 ----

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** xmlparse.c	2001/08/09 18:08:56	1.22
--- xmlparse.c	2001/08/23 12:35:53	1.23
***************
*** 1330,1334 ****
  const XML_LChar *
  XML_ExpatVersion(void) {
!   return VERSION;
  }
  
--- 1330,1349 ----
  const XML_LChar *
  XML_ExpatVersion(void) {
! 
!   /* V1 is used to string-ize the version number. However, it would
!      string-ize the actual version macro *names* unless we get them
!      substituted before being passed to V1. CPP is defined to expand
!      a macro, then rescan for more expansions. Thus, we use V2 to expand
!      the version macros, then CPP will expand the resulting V1() macro
!      with the correct numerals. */
!   /* ### I'm assuming cpp is portable in this respect... */
! 
! #define V1(a,b,c) "expat_"#a"."#b"."#c
! #define V2(a,b,c) V1(a,b,c)
! 
!   return V2(XML_MAJOR_VERSION, XML_MINOR_VERSION, XML_MICRO_VERSION);
! 
! #undef V1
! #undef V2
  }
  

--- expat.h.in DELETED ---