# HG changeset patch # User Paul Boddie # Date 1624824602 -7200 # Node ID acf2b78e9ee587e96631182102d0cd35622f96d0 # Parent e6da95e33e43e2ee0be438bb49b7535978b08840 Added a ValueError-raising convenience function. diff -r e6da95e33e43 -r acf2b78e9ee5 templates/progops.c --- a/templates/progops.c Tue Jun 22 23:03:52 2021 +0200 +++ b/templates/progops.c Sun Jun 27 22:10:02 2021 +0200 @@ -1,6 +1,6 @@ /* Operations depending on program specifics. -Copyright (C) 2015, 2016, 2017, 2018 Paul Boddie +Copyright (C) 2015, 2016, 2017, 2018, 2021 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -161,6 +161,13 @@ __Raise(__new___builtins___core_TypeError(__NULL)); } +void __raise_value_error(__attr value) +{ +#ifdef __HAVE___builtins___exception_base_ValueError + __Raise(__new___builtins___exception_base_ValueError(__NULL, value)); +#endif /* __HAVE___builtins___exception_base_ValueError */ +} + void __raise_zero_division_error() { __Raise(__new___builtins___core_ZeroDivisionError(__NULL)); diff -r e6da95e33e43 -r acf2b78e9ee5 templates/progops.h --- a/templates/progops.h Tue Jun 22 23:03:52 2021 +0200 +++ b/templates/progops.h Sun Jun 27 22:10:02 2021 +0200 @@ -1,6 +1,6 @@ /* Operations depending on program specifics. -Copyright (C) 2015, 2016, 2017, 2018 Paul Boddie +Copyright (C) 2015, 2016, 2017, 2018, 2021 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -57,6 +57,8 @@ void __raise_unbound_method_error(); +void __raise_value_error(__attr value); + void __raise_zero_division_error(); void __raise_type_error();