Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, degenerate_762, AndrewAMD, ozgur), 774 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Multiple Translation Units for Lite-C #436073
01/18/14 12:53
01/18/14 12:53
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Hi JCL,

AFAIK there is no way to use multiple translation units in Lite-C like in standard C. I always found it very uncomfortable and very bad programming style to include C files (#include "unit1.c"). Is it possible to change the compiler to handle every .c file of a SED project as seperate translation unit? Would this require a big change in the compiler code?

Thanks!


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Multiple Translation Units for Lite-C [Re: Dark_samurai] #436371
01/24/14 12:00
01/24/14 12:00
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
@Dark_samurai: you mean: so we can just include the h files and generate object files from each c file?(Which are then linked)


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Multiple Translation Units for Lite-C [Re: Rackscha] #436379
01/24/14 14:56
01/24/14 14:56
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline OP
Serious User
Dark_samurai  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Yes that's what I ment. In ANSI C, you don't need to include every *.c file into the main *.c file like in Lite-C. Every *.c file of the project is handled as one small unit. The linker makes 1 executeable out of the object files of every c file.

Thus information hiding can be realised (one *.c file doesn't see the global variables of another *.c file if it isn't defined as extern in the header, same for "private" function which are only seen in one *.c file). This would help making programming in Lite-C "cleaner" than it is now.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Multiple Translation Units for Lite-C [Re: Dark_samurai] #436381
01/24/14 15:21
01/24/14 15:21
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Yes, for sure.

And you can use/declare things within a c file without fear of causing problems with other c files.


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development


Moderated by  aztec, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1