Re: [CVS] RPM: rpm-5_2: js/src/ jsprf.c jsstddef.h rpm/ configure.ac

2009-07-24 Thread Per Øyvind Karlsen
2009/7/23 Jeff Johnson n3...@mac.com

 This isn't the right fix imho.

 js/src needs to build standalone, not include config.h.

 Otherwise, JS is gonna become MANDATORY INTERNAL to rpm.

I thought it already was..?

--
Regards,
Per Øyvind


Re: [CVS] RPM: rpm-5_2: js/src/ jsprf.c jsstddef.h rpm/ configure.ac

2009-07-24 Thread Jeff Johnson


On Jul 24, 2009, at 6:44 AM, Per Øyvind Karlsen wrote:


2009/7/23 Jeff Johnson n3...@mac.com
This isn't the right fix imho.

js/src needs to build standalone, not include config.h.

Otherwise, JS is gonna become MANDATORY INTERNAL to rpm.
I thought it already was..?



MANDATORY (as in reliably available) yes.
INTERNAL no.

I expect to be 2nd guessed with Have it yer own way!

73 de Jeff



Re: [CVS] RPM: rpm-5_2: js/src/ jsprf.c jsstddef.h rpm/ configure.ac

2009-07-24 Thread Ralf S. Engelschall
On Thu, Jul 23, 2009, Per Øyvind Karlsen wrote:

 [...]
 fix va_list autofoo stuff breaking libjs build

I'm wondering:

1. Why is HAVE_VA_LIST_AS_ARRAY defined but never used in the code?
2. Why are such changes committed directly to 5.2 and not to HEAD first?

   Ralf S. Engelschall
   r...@engelschall.com
   www.engelschall.com

__
RPM Package Managerhttp://rpm5.org
Developer Communication Listrpm-devel@rpm5.org


Re: [CVS] RPM: rpm-5_2: js/src/ jsprf.c jsstddef.h rpm/ configure.ac

2009-07-24 Thread Per Øyvind Karlsen
2009/7/24 Ralf S. Engelschall rse+rpm-de...@rpm5.orgrse%2brpm-de...@rpm5.org


 On Thu, Jul 23, 2009, Per Ųyvind Karlsen wrote:

  [...]
  fix va_list autofoo stuff breaking libjs build

 I'm wondering:

 1. Why is HAVE_VA_LIST_AS_ARRAY defined but never used in the code?

it's actually used in jsapi.c, if not defined you'll get warnings like this
for linux on x86_64:
 jsapi.c: In function ‘JS_ConvertArgumentsVA’:
jsapi.c:273: warning: passing argument 5 of ‘TryArgumentFormatter’ from
incompatible pointer type
jsapi.c:135: note: expected ‘struct __va_list_tag (*)[1]’ but argument is of
type ‘struct __va_list_tag **’
jsapi.c: In function ‘JS_PushArgumentsVA’:
jsapi.c:381: warning: passing argument 5 of ‘TryArgumentFormatter’ from
incompatible pointer type
jsapi.c:135: note: expected ‘struct __va_list_tag (*)[1]’ but argument is of
type ‘struct __va_list_tag **’

I notice yet more mess though, I need to improve this one…


 2. Why are such changes committed directly to 5.2 and not to HEAD first?

mainly because I'm not on HEAD myself ATM, so testing and commiting on
rpm-5_2 first obviously makes more sense…

--
Regards,
Per Øyvind


Re: [CVS] RPM: rpm-5_2: js/src/ jsprf.c jsstddef.h rpm/ configure.ac

2009-07-23 Thread Jeff Johnson

This isn't the right fix imho.

js/src needs to build standalone, not include config.h.

Otherwise, JS is gonna become MANDATORY INTERNAL to rpm.

73 de Jeff

On Jul 23, 2009, at 3:19 PM, Per Øyvind Karlsen wrote:


 RPM Package Manager, CVS Repository
 http://rpm5.org/cvs/
  



 Server: rpm5.org Name:   Per Øyvind Karlsen
 Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
 Module: rpm js   Date:   23-Jul-2009 21:19:08
 Branch: rpm-5_2  Handle: 2009072319190800

 Modified files:   (Branch: rpm-5_2)
   js/src  jsprf.c jsstddef.h
   rpm configure.ac

 Log:
   fix va_list autofoo stuff breaking libjs build

 Summary:
   RevisionChanges Path
   1.1.1.1.2.1 +1  -13 js/src/jsprf.c
   1.1.1.1.2.1 +1  -0  js/src/jsstddef.h
   2.372.2.6   +28 -0  rpm/configure.ac
  



 patch -p0 '@@ .'
 Index: js/src/jsprf.c
  
= 
= 
= 
= 
= 
= 
==

 $ cvs diff -u -r1.1.1.1 -r1.1.1.1.2.1 jsprf.c
 --- js/src/jsprf.c 20 Apr 2009 18:27:13 -  1.1.1.1
 +++ js/src/jsprf.c 23 Jul 2009 19:19:08 -  1.1.1.1.2.1
 @@ -53,18 +53,6 @@
  #include jsstr.h

  /*
 -** Note: on some platforms va_list is defined as an array,
 -** and requires array notation.
 -*/
 -#ifdef HAVE_VA_COPY
 -#define VARARGS_ASSIGN(foo, bar)VA_COPY(foo,bar)
 -#elif defined(HAVE_VA_LIST_AS_ARRAY)
 -#define VARARGS_ASSIGN(foo, bar)foo[0] = bar[0]
 -#else
 -#define VARARGS_ASSIGN(foo, bar)(foo) = (bar)
 -#endif
 -
 -/*
  ** WARNING: This code may *NOT* call JS_LOG (because JS_LOG calls  
it)

  */

 @@ -641,7 +629,7 @@
  continue;
  }

 -VARARGS_ASSIGN(nas[cn].ap, ap);
 +va_copy(nas[cn].ap, ap);

  switch( nas[cn].type ){
  case TYPE_INT16:
 @@ .
 patch -p0 '@@ .'
 Index: js/src/jsstddef.h
  
= 
= 
= 
= 
= 
= 
==

 $ cvs diff -u -r1.1.1.1 -r1.1.1.1.2.1 jsstddef.h
 --- js/src/jsstddef.h  20 Apr 2009 18:27:12 -  1.1.1.1
 +++ js/src/jsstddef.h  23 Jul 2009 19:19:08 -  1.1.1.1.2.1
 @@ -79,5 +79,6 @@
  #endif

  #include stddef.h
 +#include config.h


 @@ .
 patch -p0 '@@ .'
 Index: rpm/configure.ac
  
= 
= 
= 
= 
= 
= 
==

 $ cvs diff -u -r2.372.2.5 -r2.372.2.6 configure.ac
 --- rpm/configure.ac   21 May 2009 14:49:50 -  2.372.2.5
 +++ rpm/configure.ac   23 Jul 2009 19:19:08 -  2.372.2.6
 @@ -566,6 +566,34 @@

  dnl # specific features
  AC_SYS_LARGEFILE
 +
 +dnl Does this platform require array notation to assign to a  
va_list?
 +dnl If cross-compiling, we assume va_list is normal.  If this  
breaks
 +dnl you, set ac_cv_valistisarray=true and maybe define  
HAVE_VA_LIST_AS_ARRAY

 +dnl also just to be sure.
 +AC_MSG_CHECKING(whether va_list assignments need array notation)
 +AC_CACHE_VAL(ac_cv_valistisarray,
 +  [AC_RUN_IFELSE([AC_LANG_SOURCE([[
 +#include stdlib.h
 +#include stdarg.h
 +   void foo(int i, ...) {
 +  va_list ap1, ap2;
 +  va_start(ap1, i);
 +  ap2 = ap1;
 +  if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123)
 +  { exit(1); }
 +  va_end(ap1); va_end(ap2);
 +   }
 +		 int main() { foo(0, 123); return(0); }]])], 
[ac_cv_valistisarray=false],[ac_cv_valistisarray=true], 
[ac_cv_valistisarray=false])])

 +
 +if test $ac_cv_valistisarray = true ; then
 +  AC_DEFINE(HAVE_VA_LIST_AS_ARRAY, 1,
 +  [Define as 1 if your va_list type is an array])
 +  AC_MSG_RESULT(yes)
 +else
 +   AC_MSG_RESULT(no)
 +fi
 +
  AC_CHECK_VA_COPY
  AC_CHECK_STATFS

 @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-...@rpm5.org


__
RPM Package Managerhttp://rpm5.org
Developer Communication Listrpm-devel@rpm5.org