Recent

Author Topic: FPC: Banning a unit / or finding the unit that included it  (Read 1710 times)

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
FPC: Banning a unit / or finding the unit that included it
« on: September 05, 2017, 11:29:23 pm »
Is there a way to tell FPC to "forbid" a unit from being used?

Something like {$BAN UnitName}

The reason I ask is that it seems like a program that is using VIDEO should not use CRT. So adding {$BAN CRT} could make the compiler go tits up and simply refuse to continue: Banned unit (CRT, banned at BANLIST.INC:23) encounterd, compiler is done.

Yes, I could grep -ir all my sources, but that'd also include any other reference to crt, including commented out uses of it.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: FPC: Banning a unit / or finding the unit that included it
« Reply #1 on: September 06, 2017, 03:31:46 am »
Add a blank unit with the same name into your project.
Add a directive like this {$error i am banned}
That's it

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
Re: FPC: Banning a unit / or finding the unit that included it
« Reply #2 on: September 06, 2017, 09:05:55 am »
Sweet. Thx  :D

 

TinyPortal © 2005-2018