Recent

Author Topic: Include file issues.  (Read 3201 times)

KryptKicker5

  • Newbie
  • Posts: 6
Include file issues.
« on: July 11, 2021, 02:18:23 pm »
Could someone please explain how the ".inc" files work? I was working off the assumption that it, more or less, worked like they do in C-family languages. As it's a converted header from a dynamically loaded DLL. I noticed a typo, made the change everywhere it occurred and while Lazarus can find it (the procedure), the compiler is throwing an error that it can't be located. I'm guessing that there's some compiled object somewhere, but after digging around, I have no clue where it is or how to go about forcing it to be regenerated. Any help would be much appreciated.

P.S.
Who would I submit the changes to for the fix, so that it can be updated properly?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12899
  • FPC developer.
Re: Include file issues.
« Reply #1 on: July 11, 2021, 02:31:58 pm »
.inc are includefiles, yes, and work the same as in C, including them with {$I } is pretty much as if the contents are included on that place.

But as Pascal has an unit system, they are used less, most notably to break up some historically large units in the RTL, and e.g. to separate the generic parts of an unit and the platform dependent parts.

What I think the problem is that you assume that editing the sources will automatically recursively rebuild them. That's not always the case. E.g. FPC uses prebuild units with those .inc embedded in them, and doesn't parse the source each time (which is why it is somewhat faster than complex C/C++ builds) Lazarus does sometimes rebuild the LCL though if it detects changes.

For patches and bugreports there is the bugtracker at https://bugs.freepascal.org/my_view_page.php

but that is moving to gitlab next week. But if it is your first patch, it can help to ask for comments here first.


KryptKicker5

  • Newbie
  • Posts: 6
Re: Include file issues.
« Reply #2 on: July 11, 2021, 02:47:18 pm »
Thank you both very much! I had honestly never messed with a header in Pascal before. I was incredibly lost. :(

After more digging I ended up using the compiler through the command line to re-build the units and replaced the ones I found in the compiler's directory. This was a complete first for me.

sqlite3.inc line 1060 has, "sqlite3_mutex_ente" and it should obviously be "sqlite3_mutex_enter".
(It appears other places too, but line 1060 is where I found it first.)

Thanks again for the quick response my fellow Pascalians.
« Last Edit: July 11, 2021, 02:53:54 pm by KryptKicker5 »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12899
  • FPC developer.
Re: Include file issues.
« Reply #3 on: July 11, 2021, 03:11:41 pm »
sqlite3.inc line 1060 has, "sqlite3_mutex_ente" and it should obviously be "sqlite3_mutex_enter".
(It appears other places too, but line 1060 is where I found it first.)

Fix committed, trunk r49598, fixes 49599

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12899
  • FPC developer.
Re: Include file issues.
« Reply #4 on: July 11, 2021, 03:33:52 pm »
Fix committed, trunk r49598, fixes 49599

I hope you also updated all other places that references it, too? %)

That's why I put the revision numbers in, so you could double check it  ;)

 

TinyPortal © 2005-2018