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: signature.asc
Description: Digital signature

_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev

Reply via email to