Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Problems building on Centos 5 due to embedding a directive within macro arguments #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to build memcached 1.4.0+ on Centos 5 i386 yields following error

memcached.c:3845:1: error: embedding a directive within macro arguments is
not portable
memcached.c:3851:1: error: embedding a directive within macro arguments is
not portable
make[2]: *** [memcached-memcached.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/memcached-slabs.Tpo .deps/memcached-slabs.Po
make[2]: Leaving directory `/usr/src/redhat/BUILD/memcached-1.4.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/memcached-1.4.1'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.92037 (%build)

Doing the same on Centos 5 x86_64 works fine. Fix is relatively simple.
Move out the #if defined out of printf e.g.

--- memcached.c 2009-08-29 19:00:58.000000000 -0400
+++ memcached.c.fix     2009-09-04 09:51:43.000000000 -0400
@@ -3840,16 +3840,15 @@
            "-i            print memcached and libevent license\n"
            "-P <file>     save PID in <file>, only used with -d option\n"
            "-f <factor>   chunk size growth factor (default: 1.25)\n"
-           "-n <bytes>    minimum space allocated for key+value+flags
(default: 48)\n"
+           "-n <bytes>    minimum space allocated for key+value+flags
(default: 48)\n");

 #if defined(HAVE_GETPAGESIZES) && defined(HAVE_MEMCNTL)
-           "-L            Try to use large memory pages (if available).
Increasing\n"
+    printf("-L            Try to use large memory pages (if available).
Increasing\n"
            "              the memory page size could reduce the number of
TLB misses\n"
            "              and improve the performance. In order to get
large pages\n"
            "              from the OS, memcached will allocate the total
item-cache\n"
-           "              in one large chunk.\n"
+           "              in one large chunk.\n");
 #endif
-           );

Original issue reported on code.google.com by vli...@veus.hr on 4 Sep 2009 at 4:39

GoogleCodeExporter commented 9 years ago
I had the same issue on CentOS 5 x86_64.

Original comment by seth.joh...@gmail.com on 4 Sep 2009 at 4:58

GoogleCodeExporter commented 9 years ago
Fixed

Original comment by trond.no...@gmail.com on 10 Sep 2009 at 6:47