11.2Syamt/* $NetBSD: compat_setlocale32.c,v 1.2 2013/03/06 11:29:01 yamt Exp $ */ 21.1Stnozaki 31.1Stnozaki/*- 41.1Stnozaki * Copyright (c)1999 Citrus Project, 51.1Stnozaki * All rights reserved. 61.1Stnozaki * 71.1Stnozaki * Redistribution and use in source and binary forms, with or without 81.1Stnozaki * modification, are permitted provided that the following conditions 91.1Stnozaki * are met: 101.1Stnozaki * 1. Redistributions of source code must retain the above copyright 111.1Stnozaki * notice, this list of conditions and the following disclaimer. 121.1Stnozaki * 2. Redistributions in binary form must reproduce the above copyright 131.1Stnozaki * notice, this list of conditions and the following disclaimer in the 141.1Stnozaki * documentation and/or other materials provided with the distribution. 151.1Stnozaki * 161.1Stnozaki * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 171.1Stnozaki * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 181.1Stnozaki * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 191.1Stnozaki * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 201.1Stnozaki * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 211.1Stnozaki * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 221.1Stnozaki * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 231.1Stnozaki * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 241.1Stnozaki * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 251.1Stnozaki * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 261.1Stnozaki * SUCH DAMAGE. 271.1Stnozaki * 281.1Stnozaki * NetBSD: setlocale32.c,v 1.6 2010/05/22 13:50:02 tnozaki Exp 291.1Stnozaki */ 301.1Stnozaki 311.1Stnozaki#include <sys/cdefs.h> 321.1Stnozaki#if defined(LIBC_SCCS) && !defined(lint) 331.2Syamt__RCSID("$NetBSD: compat_setlocale32.c,v 1.2 2013/03/06 11:29:01 yamt Exp $"); 341.1Stnozaki#endif /* LIBC_SCCS and not lint */ 351.1Stnozaki 361.1Stnozaki#include <sys/types.h> 371.1Stnozaki#include <compat/include/locale.h> 381.1Stnozaki 391.1Stnozaki#include "setlocale_local.h" 401.1Stnozaki 411.1Stnozaki__warn_references(__setlocale_mb_len_max_32, 421.1Stnozaki "warning: reference to compatibility __setlocale_mb_len_max_32();" 431.1Stnozaki "include <locale.h> for correct reference") 441.1Stnozaki 451.2Syamt/* 461.2Syamt * MB_LEN_MAX used to be a MD macro. it was 32 for most ports but 6 for hppa. 471.2Syamt * hppa uses arch/hppa/locale/compat_setlocale32.c instead of this file. 481.2Syamt */ 491.2Syamt#if defined(__hppa__) 501.2Syamt#error using wrong variant of compat_setlocale32.c 511.2Syamt#endif /* defined(__hppa__) */ 521.2Syamt 531.1Stnozakichar * 541.1Stnozaki__setlocale_mb_len_max_32(int category, const char *locale) 551.1Stnozaki{ 561.1Stnozaki 571.1Stnozaki /* locale may be NULL */ 581.1Stnozaki 591.1Stnozaki __mb_len_max_runtime = 32; 601.1Stnozaki return __setlocale(category, locale); 611.1Stnozaki} 62