Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2011, 12:53 PM
orkim
Sarnak
 
Join Date: Sep 2008
Location: -
Posts: 31
Default gcc and namespace fix /EQEmuLoginServer/Client.cpp

This is a little diff to work around gcc and the enum/namespace issue. Apparently from what I've found online gcc doesn't like the namespace identifier in its enums, so you must declare a variable, set it, then compare with that.

If anyone else has a better way to fix this please speak up!

Code:
Index: Client.cpp
===================================================================
--- Client.cpp  (revision 1918)
+++ Client.cpp  (working copy)
@@ -127,7 +127,8 @@
        }

        unsigned int mode = *((unsigned int*)data);
-       if(mode == (unsigned int)LoginMode::lm_from_world)
+       LoginMode myMode = lm_from_world;
+       if(mode == (unsigned int)myMode)
        {
                server_log->Log(log_network, "Session ready indicated logged in from world(unsupported feature), disconnecting.");
                connection->Close();
-ork
Reply With Quote
  #2  
Old 05-26-2011, 03:38 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

You should just be able to do this:

if(mode == (unsigned int)lm_from_world)

Is it actually an error now or still just a warning?
Reply With Quote
  #3  
Old 05-26-2011, 03:54 PM
orkim
Sarnak
 
Join Date: Sep 2008
Location: -
Posts: 31
Default

Yes, good call. Making the change you suggested keeps gcc compiling it just fine without allocating another variable for the comparison.

I think this still needs to be committed to SVN though.

Thanks,

-ork
Reply With Quote
  #4  
Old 05-26-2011, 06:58 PM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 270
Default

It looks like as of gcc 4.4, scoped and strongly typed enums are supported. Just fix the makefile.

Code:
COPTS=$(WFLAGS) -O -g -m32 -pthread -pipe -DEQLAUNCH $(DFLAGS) $(MYSQL_FLAGS) -std=c++0x

Last edited by Tabasco; 05-26-2011 at 07:00 PM.. Reason: That reall belongs in COPTS instead of WFLAGS
Reply With Quote
  #5  
Old 05-26-2011, 08:12 PM
orkim
Sarnak
 
Join Date: Sep 2008
Location: -
Posts: 31
Default

Quote:
Originally Posted by Tabasco View Post
It looks like as of gcc 4.4, scoped and strongly typed enums are supported. Just fix the makefile.

Code:
COPTS=$(WFLAGS) -O -g -m32 -pthread -pipe -DEQLAUNCH $(DFLAGS) $(MYSQL_FLAGS) -std=c++0x
Confirmed. The -std=c++0x flag allowed the desired behavior. Tested with gcc 4.4.3.

Thanks,

-ork
Reply With Quote
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 06:12 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3