From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:6214:e62:: with SMTP id jz2mr1363200qvb.21.1628839395121; Fri, 13 Aug 2021 00:23:15 -0700 (PDT) X-Received: by 2002:a25:818a:: with SMTP id p10mr1223890ybk.363.1628839394937; Fri, 13 Aug 2021 00:23:14 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 13 Aug 2021 00:23:14 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=93.41.1.126; posting-account=9fwclgkAAAD6oQ5usUYhee1l39geVY99 NNTP-Posting-Host: 93.41.1.126 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Raising "exception" in a .gpr file From: mockturtle Injection-Date: Fri, 13 Aug 2021 07:23:15 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:62496 List-Id: Dear.all, I am linting an old library of mine (suid_helper) thought to help in writin= g setuid programs. (Basically, it drops suid privileges when program starts= and allows to run in privileged mode only via few selected procedures, see= https://gitlab.com/mockturtle/suid-helper if you are curious). At the moment the library works for Linux (since I use Linux) and I guess i= t could work with most other *nixes (but setuid stuff portability is tricky= ). =20 As you can imagine, there is a part that is OS-dependent. I isolated it in= to a directory that is selected in the gpr files on the basis of the curren= t OS=20 (BTW: I am using an external value for this, there is some more "standard" = way to get the OS within the gpr file?) For sure it does not work with Windows since that OS does not have the conc= ept of "setuid executable" (as far as I know). =20 It would be nice to be able to "raise an exception" when the OS is Windows,= in the sense that the user that tries to compile (by mistake) the library = under Windows gets a message like=20 "You cannot compile this in Windows since Windows has no setuid concept" rather than getting some mysterious compile error later. Just to be clear, I am thinking to something like case OS is ...when "linux" =3D> ......Arch_Sources :=3D "src/Linux"; ...when "macos" =3D> ......Arch_Sources :=3D "src/Mac"; ...when "windows" =3D> ......raise "This library makes no sense with this OS"; end case; I tried to look in the manual, this newsgroup and googled a bit, but I did = not find anything. I am afraid that this is not possible (although I think= it could be a nice addition). Do you know if this is possible and how? Thank you in advance Riccardo