Changeset 74 for NEWT0/trunk

Show
Ignore:
Timestamp:
03/23/07 01:18:13 (20 months ago)
Author:
matthiasm
Message:

Added VC6 project file to compile a static library to later link with DyneTK. Linking works. Compiling works, Generating NSOF works and the run on the Newt. For WIN32 I created a very minimal "iconv" replacement which should just be sufficient for some initial tests. Must get back to this though!

Location:
NEWT0/trunk
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • NEWT0/trunk/platform/VisualC6/newt_app.dsp

    r73 r74  
    110110# Begin Source File 
    111111 
     112SOURCE=..\..\src\newt_core\incs\VC6\iconv.h 
     113# End Source File 
     114# Begin Source File 
     115 
    112116SOURCE=..\..\src\newt_core\incs\VC6\stdbool.h 
    113117# End Source File 
  • NEWT0/trunk/platform/VisualC6/newt_lib.dsp

    r73 r74  
    4242# PROP Target_Dir "" 
    4343# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c 
    44 # ADD CPP /nologo /W3 /GX /O2 /I "../../src" /I "../../src/newt_core/incs" /I "../../src/newt_core/incs/VC6" /I "../../src/parser" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /c 
     44# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../src" /I "../../src/newt_core/incs" /I "../../src/newt_core/incs/VC6" /I "../../src/parser" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /c 
    4545# ADD BASE RSC /l 0x409 /d "NDEBUG" 
    4646# ADD RSC /l 0x409 /d "NDEBUG" 
     
    6565# PROP Target_Dir "" 
    6666# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c 
    67 # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../src" /I "../../src/newt_core/incs" /I "../../src/newt_core/incs/VC6" /I "../../src/parser" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /GZ /c 
     67# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../src" /I "../../src/newt_core/incs" /I "../../src/newt_core/incs/VC6" /I "../../src/parser" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /GZ /c 
    6868# ADD BASE RSC /l 0x409 /d "_DEBUG" 
    6969# ADD RSC /l 0x409 /d "_DEBUG" 
     
    107107# Begin Source File 
    108108 
     109SOURCE=..\..\src\newt_core\incs\VC6\iconv.h 
     110# End Source File 
     111# Begin Source File 
     112 
    109113SOURCE=..\..\src\newt_core\incs\VC6\stdbool.h 
    110114# End Source File 
     
    330334 
    331335SOURCE=..\..\src\main.c 
     336# PROP Exclude_From_Build 1 
    332337# End Source File 
    333338# Begin Source File 
  • NEWT0/trunk/src/newt_core/NewtIconv.c

    r68 r74  
    6969} 
    7070 
     71#if _MSC_VER 
     72 
     73#include <string.h> 
     74 
     75/* 
     76 * This is a minimalistic "iconv" version which simply maps into WIN32 
     77 * native calls (not even at this point!).  
     78 *  
     79 * Requested conversions are: 
     80 *  UTF-16BE to UTF-8 and back 
     81 *  MACROMAN to UTF-8 and back 
     82 *  where UTF-8 is defined at runtime and could be something else... 
     83 */ 
     84iconv_t iconv_open(const char *tocode, const char *fromcode) 
     85{ 
     86  iconv_t mode = 0; 
     87  if (!tocode || !fromcode) 
     88    return mode; 
     89  if (strcmp(fromcode, "UTF-16BE")==0) 
     90    mode |= 1; 
     91  if (strcmp(tocode, "UTF-16BE")==0) 
     92    mode |= 2; 
     93  //printf("Requested iconv form '%s' to '%s' (our code: %d)\n", fromcode, tocode, mode); 
     94  return mode; 
     95} 
     96 
     97size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) 
     98{ 
     99  int i, n; 
     100  const char *s; 
     101  char *d; 
     102 
     103  if (!inbuf || !*inbuf || !outbuf || !*outbuf)  
     104    return 0; 
     105 
     106  n = *inbytesleft; 
     107  s = *inbuf; 
     108  d = *outbuf; 
     109 
     110  switch (cd) { 
     111  case 0: 
     112  case 3: 
     113    memmove(*outbuf, *inbuf, n); 
     114    *inbytesleft -= n; 
     115    *inbuf += n; 
     116    *outbytesleft -= n; 
     117    *outbuf += n; 
     118    break; 
     119  case 1: // from 16bit to 8bit 
     120    for (i=0; i<n; i++) { 
     121      s++; 
     122      *d++ = *s++; 
     123    } 
     124    *inbytesleft -= 2*n; 
     125    *inbuf += 2*n; 
     126    *outbytesleft -= n; 
     127    *outbuf += n; 
     128    break; 
     129  case 2: // from 8bit to 16bit 
     130    for (i=0; i<n; i++) { 
     131      *d++ = 0; 
     132      *d++ = *s++; 
     133    } 
     134    *inbytesleft -= n; 
     135    *inbuf += n; 
     136    *outbytesleft -= 2*n; 
     137    *outbuf += 2*n; 
     138    break; 
     139  } 
     140  return 0; 
     141} 
     142 
     143int iconv_close(iconv_t type) 
     144{ 
     145  return 0; 
     146} 
     147 
     148#endif 
     149 
     150 
    71151#endif /* HAVE_LIBICONV */ 
  • NEWT0/trunk/src/newt_core/incs/VC6/config.h

    r71 r74  
    1313#define CONFIG_H 
    1414 
    15  
    1615/* �}�N���� */ 
    1716#undef HAVE_INTTYPES_H 
     
    2322#undef HAVE_TERMIOS_H  
    2423 
    25 #undef HAVE_LIBICONV 
     24#define HAVE_LIBICONV 1 
    2625#undef HAVE_DLOPEN 
    2726#undef HAVE_MMAP 
  • NEWT0/trunk/src/newt_core/incs/VC6/stdbool.h

    r71 r74  
    1313#define _NEWT_VC6_STD_BOOL_H_ 
    1414 
     15#ifndef __cplusplus 
     16 
    1517typedef __int8 bool; 
    1618static const bool true = 1; 
     
    1921#endif 
    2022 
     23#endif 
     24 
  • NEWT0/trunk/src/newt_core/incs/platform.h

    r68 r74  
    2828#endif 
    2929 
     30#ifndef NEWT_EXPORT 
     31    #define NEWT_EXPORT 
     32#endif 
     33 
    3034 
    3135#endif /* PLATFORM_H */