* [Edbrowse-dev] interprocess shared files
@ 2015-05-14 19:55 Karl Dahlke
2015-05-14 22:00 ` Adam Thompson
0 siblings, 1 reply; 4+ messages in thread
From: Karl Dahlke @ 2015-05-14 19:55 UTC (permalink / raw)
To: Edbrowse-dev
Ok, that wasn't hard.
stringfile.c url.c messages.c is now a group of code that is
shared between any and all of the edbrowse processes,
even those that are c++.
The tweak that makes the latter possible is this in eb.h.
#ifndef __cplusplus
typedef uchar bool;
#define false 0
#define true 1
#endif
No other plusplus conditional compilation is necessary, anywhere.
That's good cause I dislike conditional compilation.
I did have to make some other changes in the c files but those are minor
and work fine in either language.
One silly example was the use of new as a variable,
which obviously blows up in c++ so I just rename the variable.
Anyways Adam you are good to go with
cp jseng-moz.cpp jseng-duk.c
and give it a whirl.
There are over 500 lines of code less than there use to be,
so you won't have to waste time on that,
and you have access to more functions,
including the string management functions that you will need
to replace the dynamic c++ strings,
which there are only a couple in the file anyways.
The only aesthetic downer is jseng use to include ebjs.h, small and contained,
but now it includes eb.h, which is everything.
It might be worth making a common.h intermediate to embrase the common files.
I'll hold that off for another day.
Karl Dahlke
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Edbrowse-dev] interprocess shared files
2015-05-14 19:55 [Edbrowse-dev] interprocess shared files Karl Dahlke
@ 2015-05-14 22:00 ` Adam Thompson
2015-05-14 22:32 ` Karl Dahlke
0 siblings, 1 reply; 4+ messages in thread
From: Adam Thompson @ 2015-05-14 22:00 UTC (permalink / raw)
To: Karl Dahlke; +Cc: Edbrowse-dev
[-- Attachment #1: Type: text/plain, Size: 2122 bytes --]
On Thu, May 14, 2015 at 03:55:03PM -0400, Karl Dahlke wrote:
> Ok, that wasn't hard.
> stringfile.c url.c messages.c is now a group of code that is
> shared between any and all of the edbrowse processes,
> even those that are c++.
> The tweak that makes the latter possible is this in eb.h.
>
> #ifndef __cplusplus
> typedef uchar bool;
> #define false 0
> #define true 1
> #endif
>
> No other plusplus conditional compilation is necessary, anywhere.
> That's good cause I dislike conditional compilation.
I've slightly altered this such that we now don't need ++.o versions. This was achieved by adding:
#ifdef __cplusplus
extern "C" {
#endif
After we've ran the above conditional typedef compilation and:
#ifdef __cplusplus
}
#endif
At the end of eb.h
This means we don't have to duplicate dependancies for these files in the
makefile, thus reducing the possibility for build problems later.
> I did have to make some other changes in the c files but those are minor
> and work fine in either language.
> One silly example was the use of new as a variable,
> which obviously blows up in c++ so I just rename the variable.
> Anyways Adam you are good to go with
>
> cp jseng-moz.cpp jseng-duk.c
>
> and give it a whirl.
> There are over 500 lines of code less than there use to be,
> so you won't have to waste time on that,
> and you have access to more functions,
> including the string management functions that you will need
> to replace the dynamic c++ strings,
> which there are only a couple in the file anyways.
Thanks for doing this, it'll certainly make things easier.
> The only aesthetic downer is jseng use to include ebjs.h, small and contained,
> but now it includes eb.h, which is everything.
> It might be worth making a common.h intermediate to embrase the common files.
> I'll hold that off for another day.
I'm not too sure I mind this that much.
At the end of the day it's not that bad and we shouldn't really have any
conflicting types etc which'd make this a problem.
A common.h would potentially be nicer though.
Cheers,
Adam.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Edbrowse-dev] interprocess shared files
2015-05-14 22:00 ` Adam Thompson
@ 2015-05-14 22:32 ` Karl Dahlke
2015-05-14 22:39 ` Adam Thompson
0 siblings, 1 reply; 4+ messages in thread
From: Karl Dahlke @ 2015-05-14 22:32 UTC (permalink / raw)
To: Edbrowse-dev
> I've slightly altered this such that we now don't need ++.o versions.
Excellent! I thought about that but didn't realize it would work so cleanly.
Will that sort of interoperability hold for other compilers?
Anyways I applied the same change to makefile.bsd,
which I try to keep up to date even though I don't really have a good way
to test it.
Karl Dahlke
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Edbrowse-dev] interprocess shared files
2015-05-14 22:32 ` Karl Dahlke
@ 2015-05-14 22:39 ` Adam Thompson
0 siblings, 0 replies; 4+ messages in thread
From: Adam Thompson @ 2015-05-14 22:39 UTC (permalink / raw)
To: Karl Dahlke; +Cc: Edbrowse-dev
[-- Attachment #1: Type: text/plain, Size: 612 bytes --]
On Thu, May 14, 2015 at 06:32:52PM -0400, Karl Dahlke wrote:
> > I've slightly altered this such that we now don't need ++.o versions.
>
> Excellent! I thought about that but didn't realize it would work so cleanly.
> Will that sort of interoperability hold for other compilers?
> Anyways I applied the same change to makefile.bsd,
> which I try to keep up to date even though I don't really have a good way
> to test it.
Thanks. It should work; I'll test on Mac OsX to check.
No idea about Windows compilation, I don't even know if we can do that without
Cygwin or MinGW anyway.
Cheers,
Adam.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-14 22:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 19:55 [Edbrowse-dev] interprocess shared files Karl Dahlke
2015-05-14 22:00 ` Adam Thompson
2015-05-14 22:32 ` Karl Dahlke
2015-05-14 22:39 ` Adam Thompson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).