Lichen

Changeset

928:acf2b78e9ee5
2021-06-27 Paul Boddie raw files shortlog changelog graph Added a ValueError-raising convenience function.
templates/progops.c (file) templates/progops.h (file)
     1.1 --- a/templates/progops.c	Tue Jun 22 23:03:52 2021 +0200
     1.2 +++ b/templates/progops.c	Sun Jun 27 22:10:02 2021 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4  /* Operations depending on program specifics.
     1.5  
     1.6 -Copyright (C) 2015, 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk>
     1.7 +Copyright (C) 2015, 2016, 2017, 2018, 2021 Paul Boddie <paul@boddie.org.uk>
     1.8  
     1.9  This program is free software; you can redistribute it and/or modify it under
    1.10  the terms of the GNU General Public License as published by the Free Software
    1.11 @@ -161,6 +161,13 @@
    1.12      __Raise(__new___builtins___core_TypeError(__NULL));
    1.13  }
    1.14  
    1.15 +void __raise_value_error(__attr value)
    1.16 +{
    1.17 +#ifdef __HAVE___builtins___exception_base_ValueError
    1.18 +    __Raise(__new___builtins___exception_base_ValueError(__NULL, value));
    1.19 +#endif /* __HAVE___builtins___exception_base_ValueError */
    1.20 +}
    1.21 +
    1.22  void __raise_zero_division_error()
    1.23  {
    1.24      __Raise(__new___builtins___core_ZeroDivisionError(__NULL));
     2.1 --- a/templates/progops.h	Tue Jun 22 23:03:52 2021 +0200
     2.2 +++ b/templates/progops.h	Sun Jun 27 22:10:02 2021 +0200
     2.3 @@ -1,6 +1,6 @@
     2.4  /* Operations depending on program specifics.
     2.5  
     2.6 -Copyright (C) 2015, 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk>
     2.7 +Copyright (C) 2015, 2016, 2017, 2018, 2021 Paul Boddie <paul@boddie.org.uk>
     2.8  
     2.9  This program is free software; you can redistribute it and/or modify it under
    2.10  the terms of the GNU General Public License as published by the Free Software
    2.11 @@ -57,6 +57,8 @@
    2.12  
    2.13  void __raise_unbound_method_error();
    2.14  
    2.15 +void __raise_value_error(__attr value);
    2.16 +
    2.17  void __raise_zero_division_error();
    2.18  
    2.19  void __raise_type_error();