Page 1 of 1

Compiling on freebsd 4.8

Posted: Sat Jul 02, 2005 6:39 pm
by Darax The Good
My server is running FreeBSD 4.8, and apparently I don't have the 'atoll' function-so I thought I'd be clever and strip it down to atol. It worked and everything compiled (once I changed the macros in loader.c to not span multiple lines) and I went to start the server.

And I got caught in my little trick. It looks like the server is doing some sanity checks on startup-like making sure that the experience tables don't flatten off-and it is refusing to start.

So...

Has anyone succesfully compiled 1.7 on freebsd? Is there a library or something that i can get to make atoll part of my enlistment? Or is there an equivalient to atoi64/atoll for freebsd that I can go replacing this stuff with?

Posted: Sat Jul 02, 2005 11:04 pm
by bort
Answer: Try ports.
Long Answer:
Apply this patch:

Code: Select all

--- common/exp.c.orig   Sat Mar 27 06:59:25 2004
+++ common/exp.c        Thu Aug 26 05:56:20 2004
@@ -190,7 +190,7 @@
                exit(1);
            }

-           tmpexp = atoll(cp);
+           tmpexp = strtoll(cp, (char **)NULL, 10);
            /* Do some sanity checking - if value is bogus, just exit because
             * the table otherwise is probably in an inconsistent state
             */
And this patch

Code: Select all

--- common/loader.l.orig        Sat Mar 27 06:59:28 2004
+++ common/loader.l     Thu Aug 26 05:54:55 2004
@@ -632,8 +632,8 @@
 ^maxsp{S}      op->stats.maxsp = IVAL;
 ^grace{S}      op->stats.grace = IVAL;
 ^maxgrace{S}   op->stats.maxgrace = IVAL;
-^exp{S}                op->stats.exp = atoll(yval());
-^perm_exp{S}   op->perm_exp = atoll(yval());
+^exp{S}                op->stats.exp = strtoll(yval(), (char **)NULL, 10);
+^perm_exp{S}   op->perm_exp = strtoll(yval(), (char **)NULL, 10);
 ^food{S}       op->stats.food = IVAL;
 ^dam{S}                op->stats.dam = IVAL;
 ^wc{S}         op->stats.wc = IVAL;
That should work. Use the patch program.
If you dont know how to use it, google for "how to use patch".

Posted: Sun Jul 03, 2005 6:58 am
by Darax The Good
I did a #define atoll(n) strtoll(n,(char **)NULL,10)

in the files that needed it.

Now I await my port to be unblocked.

Posted: Sun Jul 03, 2005 8:25 pm
by bort
Blocked? :?