Raised This Month: $ Target: $400
 0% 

enum constant already defined


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bobakanoosh
Senior Member
Join Date: Sep 2015
Location: United States
Old 04-25-2020 , 02:25   enum constant already defined
Reply With Quote #1

I'm trying to compile an old library of mine (SM version ~1.7-1..

I have an enum in several files, defined as following:
Code:
enum ActiveLRHandler {}
Depending on the module, I have a variable number of enumerations defined (some plugins only require 2, some require 10). Because the enumerations in arrays, this sames memory.

When compiling, I get "error 050 constant already defined". I've found this because the enums sometimes define the same variable name.

Any idea how I can fix this without a workaround/refactor?

Last edited by Bobakanoosh; 04-25-2020 at 02:29.
Bobakanoosh is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-25-2020 , 07:08   Re: enum constant already defined
Reply With Quote #2

Quote:
Originally Posted by Bobakanoosh View Post
Because the enumerations in arrays, this sames memory.
This "enum struct" syntax is being removed, replaced by a struct-like syntax instead (see the thread stickied in this forum), so you'll probably need to refactor anyway.
__________________
asherkin is offline
Bobakanoosh
Senior Member
Join Date: Sep 2015
Location: United States
Old 04-25-2020 , 14:23   Re: enum constant already defined
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
This "enum struct" syntax is being removed, replaced by a struct-like syntax instead (see the thread stickied in this forum), so you'll probably need to refactor anyway.
To clarify, you're saying I should use this: https://forums.alliedmods.net/showthread.php?t=323206
to refactor?

Last edited by Bobakanoosh; 04-25-2020 at 14:28.
Bobakanoosh is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-25-2020 , 16:10   Re: enum constant already defined
Reply With Quote #4

Sticky: Enum Structs Available This Holiday Season
__________________
Do not Private Message @me
Bacardi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode