[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] can libevent-devel for x86_64 and i686 coexist on a x86_64 machine?
That's plausible; packagers should probably indeed do something like
this; I hope that the package maintainer accepts it or something likes
it.
Tested it and it works to absolute perfection! I've done the changes
exactly as I listed them in my previous post and have also created a
small 'hello' program to test it:
#include <stdio.h>
#include <event-config.h>
int main(void)
{
printf("Size of long is %u\n",_EVENT_SIZEOF_LONG);
return 0;
}
[zeek@test1 ~]$ gcc -o hello hello.c
[zeek@test1 ~]$ ./hello
Size of long is 8
[zeek@xp1 ~]$ gcc -o hello -m32 hello.c
[zeek@xp1 ~]$ ./hello
Size of long is 4
So, it works. There is one thing I am not 100% sure though - at the very
top of both -32 and -64 versions of event-config.h there is the following:
/* event-config.h
* Generated by autoconf; post-processed by libevent.
* Do not edit this file.
* Do not rely on macros in this file existing in later versions.
*/
Does this mean that this file could be changed by autoconf then? Because
if that is the case the new-look event-config.h will be absolutely
screwed and there is no point on doing anything as the next time
autoconf decides to change that file all will be lost and it will all be
back to square one!
You might also mention in the header there that the new file is
provided by the distribution, not by Libevent itself.
I'll put a note to be included when I submit the bug report to Fedora,
no worries.
I've (shamelessly) borrowed the skeleton for the above from the
openssl-devel package. The only sticking point is with "#if
defined(__x86_64__)" as I am not 100% certain that is 'automatically'
defined by the preprocessor - I need to check whether that is indeed the
case.
You can get a list of macros automatically defined by gcc with
echo "" | gcc -E -dM -x c - | sort
Yep, a lot of other (useful) macros defined as well: both __x86_64__ and
__x86_64 were defined as '1' as well as __k8__/__k8, __amd64__/__amd64
etc, so that proved to be very and I'll certainly use it in my
development work as it is easy to branch out arch-dependent code that
way without relying on pseudo-gimmicks to do that.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.