From:
Operating system:
PHP version: 5.4.0RC8
Package: *General Issues
Bug Type: Bug
Bug description:PHP_EOL definition for Mac OS X is wrong and unused
Description:
------------
php.h contains:
#ifdef PHP_WIN32
# include "tsrm_win32.h"
# include "win95nt.h"
# ifdef PHP_EXPORTS
# define PHPAPI __declspec(dllexport)
# else
# define PHPAPI __declspec(dllimport)
# endif
# define PHP_DIR_SEPARATOR '\\'
# define PHP_EOL "\r\n"
#else
# if defined(__GNUC__) && __GNUC__ >= 4
# define PHPAPI __attribute__ ((visibility("default")))
# else
# define PHPAPI
# endif
#define THREAD_LS
#define PHP_DIR_SEPARATOR '/'
#if defined(__MacOSX__)
#define PHP_EOL "\r"
#else
#define PHP_EOL "\n"
#endif
#endif
The indentation is bad, the value of PHP_EOL on Mac OS X is wrong, and the
code
never gets into the line that defines it incorrectly because there is no
such
macro as __MacOSX__. Instead you should test for __APPLE__ & __MACH__, in
general, but in this case you should just remove the whole test for
__MacOSX__
because it's not needed.
--
Edit bug report at https://bugs.php.net/bug.php?id=61193&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61193&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61193&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=61193&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61193&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=61193&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61193&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=61193&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=61193&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=61193&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=61193&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=61193&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=61193&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=61193&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61193&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=61193&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61193&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=61193&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=61193&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=61193&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=61193&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=61193&r=mysqlcfg