Ludophonic
|
|
« Reply #1800 on: March 04, 2011, 01:03:32 AM » |
|
I actually did a little research and it seems you can pretty much expect this behaviour everywhere It was supposed to work the way you would think, with everything in std. But no one got it right. So in the draft C++0x standard they've "codified existing practice" and allow the <cname> headers to go into the global namespace as long as they also get added to the std namespace too. Every C header, each of which has a name of the form name.h, behaves as if each name placed in the standard library namespace by the corresponding cname header is placed within the global namespace scope. It is unspecified whether these names are first declared or defined within namespace scope (3.3.6) of the namespace std and are then injected into the global namespace scope by explicit using-declarations (7.3.3).
|
|
« Last Edit: March 04, 2011, 01:19:12 AM by Ludophonic »
|
Logged
|
|
|
|
oahda
|
|
« Reply #1801 on: March 04, 2011, 05:18:44 AM » |
|
( I'm curious, anyone want to try compiling this on MSVC? My copy of VS has apparently expired or something and wants me to register ) I believe registration is free.
|
|
|
Logged
|
|
|
|
Average Software
|
|
« Reply #1802 on: March 04, 2011, 05:54:31 AM » |
|
So: implicitly including string.h, etc via set sounds like very wrong behavior to me. However: It is parity behavior with Linux. If I test-compile: #include <set>
int main() { strlen("test"); return 0; }
This compiles for me, against my intuition, on both OS X (Apple-gcc 4.2.1) and Ubuntu (gcc 4.2.4). There's this obnoxious thing where gcc on every platform needs to be bug-compatible with each other, because otherwise people will write code that implicitly depends on mainline GCC's bugs and then tarballs won't compile on os x or whatever :| ( I'm curious, anyone want to try compiling this on MSVC? My copy of VS has apparently expired or something and wants me to register ) It looks like this has been fixed in newer GCCs. bash-4.1$ cat main.cpp #include <set>
int main() { strlen("test"); }
bash-4.1$ g++ main.cpp main.cpp: In function 'int main()': main.cpp:5:18: error: 'strlen' was not declared in this scope bash-4.1$ gcc -v Reading specs from /usr/lib/gcc/i486-slackware-linux/4.5.2/specs COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i486-slackware-linux/4.5.2/lto-wrapper Target: i486-slackware-linux Configured with: ../gcc-4.5.2/configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,java,objc,lto --enable-threads=posix --enable-checking=release --with-system-zlib --with-python-dir=/lib/python2.6/site-packages --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --enable-lto --with-gnu-ld --verbose --with-arch=i486 --target=i486-slackware-linux --build=i486-slackware-linux --host=i486-slackware-linux Thread model: posix gcc version 4.5.2 (GCC) bash-4.1$ Addendum: Well, maybe not. There was big header cleanup in a recent GCC version, but the namespace issue seems unresolved. Including <cstring> will cause that code to compile, even without the std:: qualification on strlen.
|
|
|
Logged
|
What would John Carmack do?
|
|
|
mcc
|
|
« Reply #1803 on: March 04, 2011, 08:50:26 AM » |
|
( I'm curious, anyone want to try compiling this on MSVC? My copy of VS has apparently expired or something and wants me to register ) I believe registration is free. But then Microsoft will have my email address
|
|
|
Logged
|
|
|
|
Overkill
|
|
« Reply #1804 on: March 04, 2011, 11:00:58 AM » |
|
( I'm curious, anyone want to try compiling this on MSVC? My copy of VS has apparently expired or something and wants me to register ) I believe registration is free. But then Microsoft will have my email address Could register with a throwaway email service like mailinator.
|
|
|
Logged
|
|
|
|
lapsus
|
|
« Reply #1805 on: March 04, 2011, 01:03:06 PM » |
|
( I'm curious, anyone want to try compiling this on MSVC? My copy of VS has apparently expired or something and wants me to register ) tried it and it compiles fine in my version of VS2010
|
|
|
Logged
|
|
|
|
mcc
|
|
« Reply #1806 on: March 04, 2011, 01:43:18 PM » |
|
( I'm curious, anyone want to try compiling this on MSVC? My copy of VS has apparently expired or something and wants me to register ) tried it and it compiles fine in my version of VS2010 Yeah just tried it in VS 2008 professional and it compiled there too (AND it did the <cstring>-pollutes-global namespace thing). Huh.
|
|
|
Logged
|
|
|
|
Ludophonic
|
|
« Reply #1807 on: March 04, 2011, 03:56:52 PM » |
|
I went to try this in VS2010 but it looks like some people beat me to it. Why was I beaten? Because for some reason VS2010 was crashing whenever I tried to compile a cpp file. Even if the cpp was empty. After some sleuthing I found uninstalling AMD CodeAnalyst fixed it so I can compile. (And get the same results as everyone else - stuff compiles that you would think shouldn't)
|
|
|
Logged
|
|
|
|
mcc
|
|
« Reply #1808 on: March 04, 2011, 10:48:25 PM » |
|
I went to try this in VS2010 but it looks like some people beat me to it. Why was I beaten? Because for some reason VS2010 was crashing whenever I tried to compile a cpp file. Even if the cpp was empty. After some sleuthing I found uninstalling AMD CodeAnalyst fixed it so I can compile. (And get the same results as everyone else - stuff compiles that you would think shouldn't) That sounds like a good reason to be grumpy!
|
|
|
Logged
|
|
|
|
teomat
Guest
|
|
« Reply #1809 on: March 07, 2011, 10:26:47 AM » |
|
I need a break from my current project and I want to make a small game, but I don't know in which language. ;_; I thinking about either c++ (using allegro or clanlib) or lua (using love2d).
I'm not sure about c++, I still remember the debugging pain from my first game. And I never did anything in lua (I don't knwo what to think about tables, they scare me).
I think I'll try lua and switch to c++ if I don't like it...
Also: screw flash, c# and java...
edit: Ok, after reading some more about tables in lua: they do sound nice but they still scare me
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #1810 on: March 07, 2011, 06:10:10 PM » |
|
I need a break from my current project and I want to make a small game, but I don't know in which language. ;_; I thinking about either c++ (using allegro or clanlib) or lua (using love2d).
I'm not sure about c++, I still remember the debugging pain from my first game. And I never did anything in lua (I don't knwo what to think about tables, they scare me).
I think I'll try lua and switch to c++ if I don't like it...
Also: screw flash, c# and java...
edit: Ok, after reading some more about tables in lua: they do sound nice but they still scare me
How about both? C++ with a Lua binding.
|
|
|
Logged
|
|
|
|
Triplefox
|
|
« Reply #1811 on: March 07, 2011, 08:13:59 PM » |
|
Argh GUI :< I wasted time trying to be clever about drawing these button-like tabs to cover each other: | | <sidebar> | | |/-------------------- / -------------------- ----- ----- ----- /| A |/| B |/| C | ... / ----- ----- ----- / / / / / / -------------------- /| <sidebar> |
Basically I wanted to do stuff where I drew one big image for up and then pasted in part of one big image for down. The problem is that when pushing them down all the clever simple ideas for drawing tend to get screwed up by the pseudo-3D-ness and overlap. So I'm just going to go back and rework the buttons into a big spritesheet with up and down states and add those sprites on the scenegraph. Meh. At least it wasn't too much time wasted.
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #1812 on: March 07, 2011, 09:25:55 PM » |
|
I have no idea what that ASCII art is supposed to be. You should draw an image to upload instead.
|
|
|
Logged
|
|
|
|
mcc
|
|
« Reply #1813 on: March 07, 2011, 09:54:51 PM » |
|
LOG ROTATION
* endless stream of curse words *
|
|
|
Logged
|
|
|
|
bengrue
|
|
« Reply #1814 on: March 08, 2011, 11:40:19 PM » |
|
Curse HTML5 canvas, and curse how every browser renders fonts differently in it.
Am I really going to have to write a pixel font rasterizer if I want textboxes and menus to look the same across all platforms? Really?
|
|
|
Logged
|
|
|
|
bateleur
|
|
« Reply #1815 on: March 09, 2011, 02:48:17 AM » |
|
every browser renders fonts differently in it I warned people HTML5 would be like this! I warned everyone! But did they listen? Nooo. It was all "Flash doesn't run on my iThing, waaah, waaah!". More seriously, I sympathise with your pain. I spent many months wrestling with similar problems involving mobile Java stuff. Standards that fail to standardize: Using them is no fun, takes forever and what you end up with is invariably horrendous if it even works at all.
|
|
|
Logged
|
|
|
|
_Tommo_
|
|
« Reply #1816 on: March 09, 2011, 04:28:18 AM » |
|
I'm grumpy and I will be for some time, until i finish the editor for my game... and I hate editors and GUI with all myself!
Also, level.cpp is 790 LOCs now, which is waaay too much.
|
|
|
Logged
|
|
|
|
Cthulhu32
|
|
« Reply #1817 on: March 09, 2011, 08:25:31 AM » |
|
I was personally responsible for discovering a bug in IE8 a few weeks ago. There's a flag, DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION, that sets a flag in the IE web control telling IE to signal a BeforeNavigate2 on every redirect including 302s. Apparently this works fine in IE7 and IE9 beta, but someone introduced a bug into IE8 that returns from the redirect statement too early and never fires this. I had a sr. engineer from Microsoft confirm the bug and tell me it would take 3-6 months of intensive testing to get it fixed in their source, but that we should just wait for IE9 to come out. Microsoft IE dev team, you've made my life harder.
|
|
|
Logged
|
|
|
|
mcc
|
|
« Reply #1818 on: March 10, 2011, 12:36:51 AM » |
|
Apple released XCode 4 on my birthday! Off to the happy programer roEXCEPT WAIT NO.
Along with this Apple announced that the XCode package-- breaking with what must be 20 years of free basic developer tools from Apple-- will now be $5, a totally perfunctory amount of money that might as well be $infinity for the logistical difficulties it creates once XCode 3 leaves its support cycle.
Aside from me having no idea how we're going to handle this at work, I'm totally baffled how I handle this with the open source package I distribute. No problem for the iPhone target (registered iPhone developers can continue to just download a free dmg) but do I need to start treating my mac target differently since I can probably no longer assume everyone is using the most current version of XCode? Like, is it okay to distribute mac .xcodeproj's in XCode 4 format? If someone doesn't want to pay for XCode, will they still be able to get the basic GPLed components like make and gcc? (Opensource.apple.com currently has the 3.2 developer tools, but not 4.x-- yet?). Am I going to have to make a mac makefile for these people? Is xcodebuild in the open source part of Apple's developer tools, can they use that? Is someone going to have to create a third-party xcodebuild equivalent for use by people who are using the free XCode 3.x but need to use 4.0 xcodeproj files, and/or people who install apple-gcc but not XCode?
Why is Apple creating confusing logistical headaches and splits in their developer base to get five dollars out of people who just paid them $1200 for a computer?
|
|
« Last Edit: March 10, 2011, 12:47:37 AM by mcc »
|
Logged
|
|
|
|
Izze
|
|
« Reply #1819 on: March 10, 2011, 12:52:03 AM » |
|
Apple released XCode 4 on my birthday! Off to the happy programer roEXCEPT WAIT NO.
Along with this Apple announced that the XCode package-- breaking with what must be 20 years of free basic developer tools from Apple-- will now be $5, a totally perfunctory amount of money that might as well be $infinity for the logistical difficulties it creates once XCode 3 leaves its support cycle.
Aside from me having no idea how we're going to handle this at work, I'm totally baffled how I handle this with the open source package I distribute. No problem for the iPhone target (registered iPhone developers can continue to just download a free dmg) but do I need to start treating my mac target differently since I can probably no longer assume everyone is using the most current version of XCode? Like, is it okay to distribute mac .xcodeproj's in XCode 4 format? If someone doesn't want to pay for XCode, will they still be able to get the basic GPLed components like make and gcc? (Opensource.apple.com currently has the 3.2 developer tools, but not 4.x-- yet?). Am I going to have to make a mac makefile for these people? Is xcodebuild in the open source part of Apple's developer tools, can they use that? Is someone going to have to create a third-party xcodebuild equivalent for use by people who are using the free XCode 3.x but need to use 4.0 xcodeproj files, and/or people who install apple-gcc but not XCode?
Why is Apple creating confusing logistical headaches and splits in their developer base to get five dollars out of people who just paid them $1200 for a computer?
Because it's Apple. Also: PHP!!!!!!!!!! I always end up with spaghetti and shit all over my websites.
|
|
|
Logged
|
|
|
|
|