On 17/11/2012, at 10:42 AM, Tim Margheim wrote:

> On 11/16/2012 5:34 PM, john skaller wrote:
>> I ran it on OSX.  I don't have a Windows development system.
>> A couple of people have built Felix for Win64 including
>> running the regression test suite successfully, but there
>> aren't many JudySL tests in the suite.
> Ah.  This bug may be specific to Windows, or specific to the Visual Studio 
> 2010 compiler, or specific to Pradeep's edits.
> 
> Pradeep, would you be able to test this on your system?  Again, the problem 
> is that in the attached test code, the first and last searches return NULL 
> instead of 7, which is the value for ".22 calibre".


My Judy.h looks like this at the top:
/////////////////////////////////////////////////////////////

#ifndef _JUDY_INCLUDED
#define _JUDY_INCLUDED
// _________________
//
// Copyright (C) 2000 - 2002 Hewlett-Packard Company
//
// This program is free software; you can redistribute it and/or modify it
// under the term of the GNU Lesser General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
// for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
// _________________

// @(#) $Revision: 4.52 $ $Source: /judy/src/Judy.h $
//
// HEADER FILE FOR EXPORTED FEATURES IN JUDY LIBRARY, libJudy.*
//
// See the manual entries for details.
//
// Note:  This header file uses old-style comments on #-directive lines and
// avoids "()" on macro names in comments for compatibility with older cc -Aa
// and some tools on some platforms.


#ifndef JUDY_EXTERN
#if defined(_WIN32) && !defined(FLX_STATIC_LINK)
#ifdef BUILD_JUDY
#define JUDY_EXTERN __declspec(dllexport)
#else
#define JUDY_EXTERN __declspec(dllimport)
#endif
#else
#define JUDY_EXTERN
#endif
#endif

/* here JU_WIN <=> MSVC CL build */
/* JU_WIN needs defining in JudyTable*Gen.c before to avoid inclusion
   of <unistd.h> *before* this header is included. The net effect is
   that JU_WIN should already be defined in this circumstance and so
   check on !defined(JU_WIN) to avoid a preprocessor warning. */

#if defined(_MSC_VER) && !defined(JU_WIN)
#define JU_WIN
#endif



// ISO C99: 7.8 Format conversion of integer types <inttypes.h>
//#include <inttypes.h>  /* if this FAILS, try #include <stdint.h> */ 

// ISO C99: 7.18 Integer types uint*_t 
#include <stdint.h>  


// ISO C99 Standard: 7.20 General utilities
#include <stdlib.h>  

// ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types
#include <limits.h>  

#ifdef __cplusplus      /* support use by C++ code */
extern "C" {
#endif


// ****************************************************************************
// DECLARE SOME BASE TYPES IN CASE THEY ARE MISSING:
//
// These base types include "const" where appropriate, but only where of
// interest to the caller.  For example, a caller cares that a variable passed
// by reference will not be modified, such as, "const void * Pindex", but not
// that the called function internally does not modify the pointer itself, such
// as, "void * const Pindex".
//
// Note that its OK to pass a Pvoid_t to a Pcvoid_t; the latter is the same,
// only constant.  Callers need to do this so they can also pass & Pvoid_t to
// PPvoid_t (non-constant).

#ifndef _PCVOID_T
#define _PCVOID_T
typedef const void * Pcvoid_t;
#endif

#ifndef _PVOID_T
#define _PVOID_T
typedef void *   Pvoid_t;
typedef void ** PPvoid_t;
#endif

#ifndef _WORD_T
#define _WORD_T
#if defined(_WIN64)
typedef unsigned long long   Word_t, * PWord_t;  // expect 32-bit or 64-bit 
words.
#else
typedef unsigned long    Word_t, * PWord_t;  // expect 32-bit or 64-bit words.
#endif
#endif

#ifndef NULL
#define NULL 0
#endif

/////////////////////////////////////////////////////////

and then goes on like this:

//////////////////////////////////////////////////////
// JUDY1 FUNCTIONS:

extern int      JUDY_EXTERN Judy1Test(       Pcvoid_t  PArray, Word_t   Index,  
 P_JE);
extern int      JUDY_EXTERN Judy1Set(        PPvoid_t PPArray, Word_t   Index,  
 P_JE);
extern int      JUDY_EXTERN Judy1SetArray(   PPvoid_t PPArray, Word_t   Count,
                                             const Word_t * const PIndex,
                                                                     P_JE);
extern int      JUDY_EXTERN Judy1Unset(      PPvoid_t PPArray, Word_t   Index,  
 P_JE);
extern Word_t   JUDY_EXTERN Judy1Count(      Pcvoid_t  PArray, Word_t   Index1,
                                                   Word_t   Index2,  P_JE);
extern int      JUDY_EXTERN Judy1ByCount(    Pcvoid_t  PArray, Word_t   Count,
                                                   Word_t * PIndex,  P_JE);
extern Word_t   JUDY_EXTERN Judy1FreeArray(  PPvoid_t PPArray,                  
 P_JE);
extern Word_t   JUDY_EXTERN Judy1MemUsed(    Pcvoid_t  PArray);
extern Word_t   JUDY_EXTERN Judy1MemActive(  Pcvoid_t  PArray);
extern int      JUDY_EXTERN Judy1First(      Pcvoid_t  PArray, Word_t * PIndex, 
 P_JE);
extern int      JUDY_EXTERN Judy1Next(       Pcvoid_t  PArray, Word_t * PIndex, 
 P_JE);
extern int      JUDY_EXTERN Judy1Last(       Pcvoid_t  PArray, Word_t * PIndex, 
 P_JE);
extern int      JUDY_EXTERN Judy1Prev(       Pcvoid_t  PArray, Word_t * PIndex, 
 P_JE);
extern int      JUDY_EXTERN Judy1FirstEmpty( Pcvoid_t  PArray, Word_t * PIndex, 
 P_JE);
extern int      JUDY_EXTERN Judy1NextEmpty(  Pcvoid_t  PArray, Word_t * PIndex, 
 P_JE);
extern int      JUDY_EXTERN Judy1LastEmpty(  Pcvoid_t  PArray, Word_t * PIndex, 
 P_JE);
extern int      JUDY_EXTERN Judy1PrevEmpty(  Pcvoid_t  PArray, Word_t * PIndex, 
 P_JE);

extern PPvoid_t JUDY_EXTERN JudyLGet(        Pcvoid_t  PArray, Word_t    Index, 
 P_JE);
extern PPvoid_t JUDY_EXTERN JudyLIns(        PPvoid_t PPArray, Word_t    Index, 
 P_JE);
extern int      JUDY_EXTERN JudyLInsArray(   PPvoid_t PPArray, Word_t    Count,
                                             const Word_t * const PIndex,
                                             const Word_t * const PValue,


//////////////////////////////////////////////////////


This is Felix specific encoding to support proper export/import from DLLs.
The setting of JUDY_EXTERN depends on macro BUILD_JUDY which is
set on the compiler command line when building the library and left
unset when using, and FLX_STATIC_LINK is specified to signify we're making
or using a static link library.

I cannot identify exactly where the changes are from the standard Judy in the 
sourceforge repo.
At some stage we attempted use Git submodules so we could separate our Felix 
patches
from upstream changes but I gave up because they're too hard to use (and git is 
bugged
in that if you screw up the work flow you can actually break your repo).

--
john skaller
[email protected]
http://felix-lang.org




------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel

Reply via email to