Changeset 26649


Ignore:
Timestamp:
2013-01-10T15:23:59+13:00 (11 years ago)
Author:
davidb
Message:

Code changed from using WIN32 use to _MSC_VER (the difference being the former is set for any Windows based compiler, whilst the latter is specifically set by a MicroSoft Visual Studio compiler). Up to this point the difference was not important, however to allow for cross-compilation (using mingw under Linux to produce native Windows binaries) the difference is imporant, and needs to be used more carefully

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/src/getpw/getpw.cpp

    r23048 r26649  
    5454
    5555// include crypt
    56 #if defined(__WIN32__)
     56#if defined(_MSC_VER)
    5757#  include <windows.h>
    5858#  include <stdio.h>
     
    6060#else
    6161#  include "config.h"
    62 #  if defined(HAVE_CRYPT_H)
     62#  include <getpass.h>
    6363#  include <crypt.h>
    64 #  endif
     64
    6565
    6666#  if defined(HAVE_UNISTD_H)
     
    7070   but for now we'll do nothing about it... */
    7171
    72 #endif  /* not WIN32 */
     72#endif  /* not _MSC_VER */
    7373
    7474#include <string.h>
    7575//#include <pwd.h>
    7676
    77 #if defined(__WIN32__)
     77#if defined(_MSC_VER)
    7878char* getPassword(HANDLE hSTDIN)
    7979{
     
    127127 
    128128  for (i=0; i<3; i++)  {
    129 #if defined(__WIN32__)
     129#if defined(_MSC_VER)
    130130    HANDLE hSTDIN;
    131131    DWORD fdwMode, fdwPrevMode;
     
    165165    strcpy (c, a);
    166166   
    167 #if defined(__WIN32__)
     167#if defined(_MSC_VER)
    168168    cerr << "Re-enter password: ";
    169169    char* b = getPassword(hSTDIN);
Note: See TracChangeset for help on using the changeset viewer.