Check for SYS/GL during library init. Reason is that
[AROS.git] / rom / utility / getuniqueid.c
blob3daef39faa810973be8982572fc461d9f6bb37d6
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <proto/exec.h>
9 #include "intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/utility.h>
16 AROS_LH0(ULONG, GetUniqueID,
18 /* SYNOPSIS */
19 /* void */
21 /* LOCATION */
22 struct UtilityBase *, UtilityBase, 45, Utility)
24 /* FUNCTION
25 Returns a unique id that is different from any other id that is
26 obtained from this function call.
28 INPUTS
30 RESULT
31 an unsigned long id
33 NOTES
35 EXAMPLE
37 BUGS
39 SEE ALSO
41 INTERNALS
42 Calls Disable()/Enable() to guarentee uniqueness.
44 HISTORY
45 29-10-95 digulla automatically created from
46 utility_lib.fd and clib/utility_protos.h
47 17-08-96 iaint Reimplemented. CVS lost my old one. Well I did.
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
52 ULONG ret;
54 Disable();
56 ret = ++(GetIntUtilityBase(UtilityBase)->ub_LastID);
58 Enable();
60 return ret;
62 AROS_LIBFUNC_EXIT
63 } /* GetUniqueID */